我刚刚安装了kubernetes本地集群,但是当我尝试命令时
cluster/kubectl.sh run my-nginx --image=nginx --replicas=2 --port=80
创建和运行pods,这是我得到的:
NAME READY STATUS RESTARTS AGE my-nginx-00t7f 0/1 ContainerCreating 0 23m my-nginx-spy2b 0/1 ContainerCreating 0 23m
我用了kubectl logs
,我得到了
Pod "my-nginx-00t7f" in namespace "default" : pod is not in 'Running', 'Succeeded' or 'Failed' state - State: "Pending"
似乎它陷入"待定"状态.然后我用'kubectl describe'得到了
Name: my-nginx-00t7f Namespace: default Image(s): nginx Node: 127.0.0.1/127.0.0.1 Start Time: Thu, 17 Dec 2015 22:27:18 +0800 Labels: run=my-nginx Status: Pending Reason: Message: IP: Replication Controllers: my-nginx (2/2 replicas created) Containers: my-nginx: Container ID: Image: nginx Image ID: QoS Tier: cpu: BestEffort memory: BestEffort State: Waiting Reason: ContainerCreating Ready: False Restart Count: 0 Environment Variables: Conditions: Type Status Ready False Volumes: default-token-p09p6: Type: Secret (a secret that should populate this volume) SecretName: default-token-p09p6 Events: FirstSeen LastSeen Count From SubobjectPath Type Reason Message --------- -------- ----- ---- ------------- -------- ------ ------- 26m 26m 1 {scheduler } Normal Scheduled Successfully assigned my-nginx-00t7f to 127.0.0.1 22m 1m 79 {kubelet 127.0.0.1} Warning FailedSync Error syncing pod, skipping: ImagePullBackOff 24m 5s 8 {kubelet 127.0.0.1} Warning FailedSync Error syncing pod, skipping: ErrImagePull
看来我的码头不能拉图像,但实际上它可以,当我没有问题docker pull nginx
.