kubectl apply says pod created however get pods shows nothing

8/1/2019

I just ran kubectl apply -f and got a response that pod/mypod got created with no error messages or anything

Then I did a kubectl get pods --all-namespaces and there is no trace of mypod!

How can I troubleshoot the pod creation? Where would these logs be, if any?

Thanks.

-- Jeff Saremi
kubernetes

2 Answers

8/1/2019

You can try to look at the logs from each of the Kubernetes components. You can start with the kube-apiserver to see what happened after the request was received. Then the kube-scheduler, and so forth.

This is likely due to Kubernetes not being able to find resources to run your pod. Are your nodes healthy? You can check them:

$ kubectl get nodes

You can also look at the logs of your kubelet on your nodes.

Notice that when you get the message pod/mypod got created it means that the objects were created in the cluster's state store (etcd)

-- Rico
Source: StackOverflow

8/1/2019
kubectl get event -n name_space

is a good start to see what went wrong which showed me Volume mount issue

An even better command to call is:

journalctl -u kubelet
-- Jeff Saremi
Source: StackOverflow