Kubernetes error syncing pod

0 votes

I installed Kubernetes, but in the creation of pod reported an error.

I use centos7, use yum to install Kubernetes.

[root@k8s-master ~]# rpm -qa |grep -i kube
kubernetes-master-1.2.0-0.11.git738b760.el7.x86_64
kubernetes-client-1.2.0-0.11.git738b760.el7.x86_64
[root@k8s-master ~]# kubectl run   my-nginx01 --image=192.168.10.58:5002/test111/nginx  --port=80
deployment "my-nginx01" created
[root@k8s-master ~]# kubectl get pods
NAME                          READY     STATUS              RESTARTS   AGE
my-nginx01-3752101197-v34jm   0/1       ContainerCreating   0          3s
[root@k8s-master ~]# kubectl describe pod my-nginx01-3752101197-v34jm
Events:
  FirstSeen LastSeen    Count   From            SubobjectPath           Type        Reason          Message
  --------- --------    -----   ----            -------------           --------    ------          -------
  22s       22s     1   {default-scheduler }                    Normal      Scheduled       Successfully assigned my-nginx01-3752101197-v34jm to 192.168.6.133
  20s       20s     1   {kubelet 192.168.6.133} spec.containers{my-nginx01} Normal      Started         Started container with docker id 3e18486078c2
  20s       20s     1   {kubelet 192.168.6.133} spec.containers{my-nginx01} Normal      Created         Created container with docker id 3e18486078c2
  21s       17s     2   {kubelet 192.168.6.133} spec.containers{my-nginx01} Normal      Pulling         pulling image "192.168.10.58:5002/test111/nginx"
  20s       16s     2   {kubelet 192.168.6.133} spec.containers{my-nginx01} Normal      Pulled          Successfully pulled image "192.168.10.58:5002/test111/nginx"
  22s       16s     3   {kubelet 192.168.6.133}                 Warning     MissingClusterDNS   kubelet does not have ClusterDNS IP configured and cannot create Pod using "ClusterFirst" policy. Falling back to DNSDefault policy.
  16s       16s     1   {kubelet 192.168.6.133} spec.containers{my-nginx01} Normal      Created         Created container with docker id 0c5c9fdd19ca
  15s       15s     1   {kubelet 192.168.6.133} spec.containers{my-nginx01} Normal      Started         Started container with docker id 0c5c9fdd19ca
  11s       11s     1   {kubelet 192.168.6.133}                 Warning     FailedSync      **Error syncing pod, skipping: failed to "StartContainer" for "my-nginx01" with CrashLoopBackOff: "Back-off 10s restarting failed container=my-nginx01 pod=my-nginx01-3752101197-v34jm_default(b4f373b3-20c3-11e6-81d6-000c294bd99a)"**
  11s   11s 1   {kubelet 192.168.6.133} spec.containers{my-nginx01} Warning BackOff Back-off restarting failed docker container
Aug 27, 2018 in Kubernetes by lina
• 8,220 points
3,714 views

1 answer to this question.

0 votes

The issue caused by the docker container which exits as soon as the "start" process finishes. Add a command that runs forever and probably it'll work. For example, recreating docker image:

#Dockerfile
[...]
CMD exec /bin/bash -c "trap : TERM INT; sleep infinity & wait"

Ready to master the future of cloud computing? Enroll now in our Kubernetes Course! Gain hands-on expertise in container orchestration, scale applications effortlessly, and streamline deployment workflows with Kubernetes.

answered Aug 27, 2018 by Kalgi
• 52,360 points

Related Questions In Kubernetes

0 votes
1 answer

Error in syncing pod - Kubernetes

You are getting this error because all you're ...READ MORE

answered Jan 4, 2019 in Kubernetes by Layla
6,025 views
0 votes
1 answer
0 votes
1 answer

Pod not sharing directory - Kubernetes volume Hostpath

he issue was on the volume definition, ...READ MORE

answered Aug 28, 2018 in Kubernetes by Kalgi
• 52,360 points
2,215 views
+1 vote
1 answer
0 votes
3 answers

Error while joining cluster with node

Hi Kalgi after following above steps it ...READ MORE

answered Jan 17, 2019 in Others by anonymous
15,328 views
+4 votes
1 answer

Installing Web UI (Dashboard):kubernetes-dashboard on main Ubuntu 16.04.6 LTS (Xenial Xerus) server

Follow these steps: $ kubeadm reset $ kubeadm init ...READ MORE

answered Apr 12, 2019 in Kubernetes by Kalgi
• 52,360 points

reshown Apr 12, 2019 by Kalgi 6,943 views
0 votes
1 answer

Error while creating kubernetes dashboard

The installation fails because there is no ...READ MORE

answered Aug 27, 2018 in Kubernetes by Kalgi
• 52,360 points
1,763 views
0 votes
1 answer

Define pod yaml dynamically-jenkins pipeline Kubernetes

Try using jinja template engine and python ...READ MORE

answered Aug 28, 2018 in Kubernetes by Kalgi
• 52,360 points
1,371 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP