xbernpa / vagrant-kubernetes-lab

Local vagrant kubernetes cluster with a master and worker node
MIT License
27 stars 27 forks source link

heapster, kube-dns, kubernetes-dashboard, tiller-deploy always stuck at 'ContainerCreating' state #6

Open Sakib37 opened 6 years ago

Sakib37 commented 6 years ago

I choose this repository as it is providing the opportunity to deploy latest Kubernetes. However, I tried this but the heapster, kube-dns, kubernetes-dashboard, tiller-deploy pod always stuck at 'ContainerCreating' state. I tried with increased memory and cpu for master and node. Also, each time I waited for around 2 hours for those pods to be running. But it did not work.

screenshot from 2018-03-25 11-48-54

coolpalani commented 6 years ago

I request you check the logs kubectl logs pods/kube-dns-6f4fd4bdf-brhd7 -n kube-system

Sakib37 commented 6 years ago

I tried, but the problem is, in "ContainerCreating" state there is no log available from a pod.

xbernpa commented 6 years ago

@Sakib37 could you provide the output of kubectl describe po of the containers stuck in ContainerCreating state : kubectl describe po -n kube-system kube-dns-6f4fd4bdf-brhd7 as I wasn't able to recreate the issue locally, this will give the reason the pods are not created in the events section of the output.

Sakib37 commented 6 years ago

Please click each link to see the output

$kubectl describe po -n kube-system kube-dns-86f4d74b45-flnvh

$ kubectl get pod --all-namespaces -o wide

stheodosis commented 6 years ago

Hi to all,

I'm facing the same problem. I think that the problem is that all pods have assigned the 10.0.2.15 IP, which is the default host only IP of vagrant deployment.

I tried to specify the interface name in the Vagrant file , with no success Please also search the https://kubernetes.io/docs/setup/independent/troubleshooting-kubeadm/ page for "Default NIC When using flannel as the pod network in Vagrant" to find more details in this problem

stheodosis commented 6 years ago

Using the default network plugin, weaver the following events appear in the describe pod command:

kubectl --namespace=kube-system describe pod kube-dns-86f4d74b45-twfq7

Events:
  Type     Reason                  Age                From                 Message
  ----     ------                  ----               ----                 -------
  Warning  FailedScheduling        9m (x15 over 12m)  default-scheduler    0/1 nodes are available: 1 node(s) were not ready.
  Warning  FailedScheduling        6m (x11 over 8m)   default-scheduler    0/2 nodes are available: 2 node(s) were not ready.
  Normal   SuccessfulMountVolume   5m                 kubelet, k8sworker1  MountVolume.SetUp succeeded for volume "kube-dns-config"
  Normal   SuccessfulMountVolume   5m                 kubelet, k8sworker1  MountVolume.SetUp succeeded for volume "kube-dns-token-c5xqw"
  Warning  FailedCreatePodSandBox  1m                 kubelet, k8sworker1  Failed create pod sandbox: rpc error: code = DeadlineExceeded desc = context deadline exceeded
  Normal   SandboxChanged          1m                 kubelet, k8sworker1  Pod sandbox changed, it will be killed and re-created.
stheodosis commented 6 years ago

The issue has been resolved by installing the vagrant-hostmanager plugin.

YiannisGkoufas commented 6 years ago

Thanks for the info @stheodosis ! I guess you have to give vagrant hostmanager after vagrant up right?

stheodosis commented 6 years ago

Hi Yiannis,

You need to install the plugin first. Afterwards no other action is needed. Perhaps you should specify the VM's IP. All hostnames map there will be in place

YiannisGkoufas commented 6 years ago

Hi Spyro, still getting the same error even after installing the hostmanager plugin :(

screenshot from 2018-05-25 15-06-21