Kubernetes 生产常见错误

==1.Pod挂在时报错,无法启动==

kubelet log

Sep 03 16:47:59 master kubelet[1677]: I0903 16:47:59.020243    1677 kuberuntime_manager.go:513] ontainer {Name:tomcatpod Image:busybox ommand: Args: WorkingDir: Ports:[{Name: HostPort:0 ontainerPort:8080 Protocol:P HostIP:}] EnvFrom: Env: Resources:{Limits:map Requests:map} VolumeMounts:[{Name:serverxml Readnly:false MountPath:/tmp SubPath:server.xml MountPropagation:<nil>} {Name:default-token-c6m5g Readnly:true MountPath:/var/run/secrets/kubernetes.io/serviceaccount SubPath: MountPropagation:<nil>}] VolumeDevices: LivenessProbe:nil ReadinessProbe:nil Lifecycle:nil erminationMessagePath:/dev/termination-log erminationMessagePolicy:File ImagePullPolicy:IfNotPresent Securityontext:nil Stdin:false Stdinnce:false Y:false} is dead, but RestartPolicy says that we should restart it.
Sep 03 16:47:59 master kubelet[1677]: I0903 16:47:59.020341    1677 kuberuntime_manager.go:757] checking backoff for container "tomcatpod" in pod "abcdocker-pod-5b59d4f7d5-x8zn7_default(e092f89f-af55-11e8-aad1-000c29c0d56b)"
Sep 03 16:47:59 master kubelet[1677]: I0903 16:47:59.020402    1677 kuberuntime_manager.go:767] Back-off 40s restarting failed container=tomcatpod pod=abcdocker-pod-5b59d4f7d5-x8zn7_default(e092f89f-af55-11e8-aad1-000c29c0d56b)
Sep 03 16:47:59 master kubelet[1677]: E0903 16:47:59.020423    1677 pod_workers.go:186] Error syncing pod e092f89f-af55-11e8-aad1-000c29c0d56b ("abcdocker-pod-5b59d4f7d5-x8zn7_default(e092f89f-af55-11e8-aad1-000c29c0d56b)"), skipping: failed to "Startontainer" for "tomcatpod" with rashLoopBackff: "Back-off 40s restarting failed container=tomcatpod pod=abcdocker-pod-5b59d4f7d5-x8zn7_default(e092f89f-af55-11e8-aad1-000c29c0d56b)"

解决办法:因为容器需要在前台运行,这种情况一般是需要先测试镜像是否有问题,在将Pod挂载前面添加命令 -w1100

Copyright © i4t.com 2019 all right reserved,powered by Gitbook该文件修订时间: 2019-04-26 21:31:27

results matching ""

    No results matching ""