运行容器命令:
[root@master-149 ~]# kubectl run my-alpine --image=alpine --replicas=2 ping www.baidu.com
查看pods状态
[root@master-149 ~]# kubectl get pods
NAME READY STATUS RESTARTS AGE
my-alpine-2150523991-knzcx 0/1 ContainerCreating 0 6m
my-alpine-2150523991-lmvv5 0/1 ContainerCreating 0 6m
Use kubectl describe pod my-alpine-2150523991-knzcx to view the events during the pod creation process, you may have surprises
I found the solution based on the reply on the 1st floor:
Execute the following command:
Among them:
It is not difficult to see that gcr.io cannot be accessed
There are the following solutions:
Climb the wall
Modify hosts file
Download the container "pause:2.0" from other sources, and then tag it as "gcr.io/google_containers/pause:2.0"
gcr.io
被墙了,可以给kubelet
加上一个参数--pod-infra-container-image
To specify a domestic mirror.We moved an image to
registry.aliyuncs.com/archon/pause-amd64:3.0
so you can use it.