kube-dns stays in ContainerCreating status

5.3k views Asked by At

I have 5 machines running Ubuntu 16.04.1 LTS. I want to set them up as a Kubernetes Cluster. Iḿ trying to follow this getting started guide where they're using kubeadm.

It all worked fine until step 3/4 Installing a pod network. I've looked at there addon page to look for a pod network and chose the flannel overlay network. Iǘe copied the yaml file to the machine and executed:

root@up01:/home/up# kubectl apply -f flannel.yml 

Which resulted in:

configmap "kube-flannel-cfg" created
daemonset "kube-flannel-ds" created

So i thought that it went ok, but when I display all the pod stuff:

root@up01:/etc/kubernetes/manifests# kubectl get pods --all-namespaces
NAMESPACE     NAME                              READY     STATUS              RESTARTS   AGE
kube-system   dummy-2088944543-d5f50            1/1       Running             0          50m
kube-system   etcd-up01                         1/1       Running             0          48m
kube-system   kube-apiserver-up01               1/1       Running             0          50m
kube-system   kube-controller-manager-up01      1/1       Running             0          49m
kube-system   kube-discovery-1769846148-jvx53   1/1       Running             0          50m
kube-system   kube-dns-2924299975-prlgf         0/4       ContainerCreating   0          49m
kube-system   kube-flannel-ds-jb1df             2/2       Running             0          32m
kube-system   kube-proxy-rtcht                  1/1       Running             0          49m
kube-system   kube-scheduler-up01               1/1       Running             0          49m

The problem is that the kube-dns keeps in the ContainerCreating state. I don't know what to do.

2

There are 2 answers

2
htaccess On BEST ANSWER

It is very likely that you missed this critical piece of information from the guide:

If you want to use flannel as the pod network, specify --pod-network-cidr 10.244.0.0/16 if you’re using the daemonset manifest below.

If you omit this kube-dns will never leave the ContainerCreating STATUS.

Your kubeadm init command should be:

# kubeadm init --pod-network-cidr 10.244.0.0/16

and not

# kubeadm init
0
Eos Antigen On

Did you try restarting NetworkManager ...? it worked for me.. Plus, it also worked when I also disabled IPv6.