我刚刚安装了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描述'并得到了
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
时没有问题。
答案 0 :(得分:2)
我认为你发现它是暂停容器,无法从Kubelet日志中提取。
Kubernetes需要为pod创建容器,以便保存共享资源,例如网络命名空间。它使用暂停容器,这是一个非常小的容器,只能永远睡觉。
答案 1 :(得分:0)
如果您的容器仍处于待处理状态,请检查kube-schedular服务。如果它处于停止状态,请将其打开并检查。