kubectl get pod status always ContainerCreating

3/15/2019

k8s version: 1.12.1

I created pod with api on node and allocated an IP (through flanneld). When I used the kubectl describe pod command, I could not get the pod IP, and there was no such IP in etcd storage.

It was only a few minutes later that the IP could be obtained, and then kubectl get pod STATUS was Running.

Has anyone ever encountered this problem?

-- 王晓磊
kubernetes

1 Answer

4/12/2019

Like MatthiasSommer mentioned in comment, process of creating pod might take a while.

If POD will stay for a longer time in ContainerCreating status you can check what is stopping it change to status Running by command:

kubectl describe pod <pod_name>

Why creating of pod may take a longer time?

Depends on what is included in manifest, pod can share namespace, storage volumes, secrets, assignin resources, configmaps etc.

kube-apiserver validates and configures data for api objects.
kube-scheduler needs to check and collect resurces requrements, constraints, etc and assign pod to the node.

kubelet is running on each node and is ensures that all containers fulfill pod specification and are healty. kube-proxy is also running on each node and it is responsible for network on pod.

As you see there are many requests, validates, syncs and it need a while to create pod fulfill all requirements.

-- PjoterS
Source: StackOverflow