k8s 创建容器一直 container creating
- K8S 创建容器后,查看pod状态,一直是 ContainerCreating
- 创建容器命令
kubectl run nginx --image=10.0.2.22:5080/general/ubuntu-nginx:16 --command -- nginx
- 下面是 kubectl describe 信息
[root@localhost ~]# kubectl describe pods nginx
Name: nginx-878073783-8hd2p
Namespace: default
Node: node82/10.0.2.82
Start Time: Thu, 14 Sep 2017 19:35:40 +0800
Labels: pod-template-hash=878073783
run=nginx
Annotations: kubernetes.io/created-by={"kind":"SerializedReference","apiVersion":"v1","reference":{"kind":"ReplicaSet","namespace":"default","name":"nginx-878073783","uid":"d61d2d0b-9940-11e7-83bc-001a4a16016d","a...
Status: Pending
IP:
Created By: ReplicaSet/nginx-878073783
Controlled By: ReplicaSet/nginx-878073783
Containers:
nginx:
Container ID:
Image: 10.0.2.22:5080/general/ubuntu-nginx:16
Image ID:
Port: <none>
Command:
nginx
State: Waiting
Reason: ContainerCreating
Ready: False
Restart Count: 0
Environment: <none>
Mounts:
/var/run/secrets/kubernetes.io/serviceaccount from default-token-hkp5r (ro)
Conditions:
Type Status
Initialized True
Ready False
PodScheduled True
Volumes:
default-token-hkp5r:
Type: Secret (a volume populated by a Secret)
SecretName: default-token-hkp5r
Optional: false
QoS Class: BestEffort
Node-Selectors: <none>
Tolerations: node.alpha.kubernetes.io/notReady:NoExecute for 300s
node.alpha.kubernetes.io/unreachable:NoExecute for 300s
Events:
FirstSeen LastSeen Count From SubObjectPath Type Reason Message
--------- -------- ----- ---- ------------- -------- ------ -------
1m 1m 1 default-scheduler Normal Scheduled Successfully assigned nginx-878073783-8hd2p to node82
1m 1m 1 kubelet, node82 Normal SuccessfulMountVolume MountVolume.SetUp succeeded for volume "default-token-hkp5r"
1m 1s 75 kubelet, node82 Normal SandboxChanged Pod sandbox changed, it will be killed and re-created.
1m 0s 76 kubelet, node82 Warning FailedSync Error syncing pod
- 截图
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
可能是k8s的api服务没装好。
Error syncing 可能是容器本身的问题。可以用
kubectl logs nginx-xxx
来看一下我也遇到这个问题。
应该去看对应 pod 所在节点的 kubelet 的日志,就能看到错误原因了。