I created pods using objects in kubernetes but the pods have status "Pending"

10/9/2017

I created pods using kubectl create -f file.yaml. Deployment successfully gets created but the status of the pods show Pending. I also have docker image available on my local repository for which I am creating the pod. I am not sure what the issue is.

The yaml file is as follows.

yaml file

Kubernetes version that I am running is 1.1.6.

-- prasun
kubernetes

3 Answers

10/9/2017

Just from that information I cannot deduce what is wrong. What I can write is how to help you address such issues. kubectl describe pod __name_of_your_pod__ kubectl describe delpoyment nginx_deployment What I think has happend you might have no cpu resources, no nodes or taints.

BTW 1.1.6 k8s is pretty old. Think about an upgrade.

-- 3h4x
Source: StackOverflow

10/9/2017

You should be able to get more info from the pod logs. For example ...

kubectl logs --tail=100 nginx-deployment

More information in the kubectl docs

Alternatively, you can open a console session, and troubleshoot from within the container itself.

kubectl get pods   # To get actual pod name
kubectl exec -it <POD_NAME>    

Another thing you can try is running your container outside of Kubernetes(using docker run -p 80:80 nginx-deployment) just to ensure that your app is running correctly, and responding etc.

You can also try running kubectl describe nodes. This might give you more info to troubleshoot with.

-- grizzthedj
Source: StackOverflow

10/9/2017

Run the following command to get the pods

kubectl get pods --all-namespaces

to find more info, run:

kubectl describe po <you-pod-name>

you should be able to get more info from that output. Mostly 1) image is still pulled 2) resources crunch or docker not running

but the error/info message should take you forward.

-- kd85
Source: StackOverflow