Overview

Eventhough Kuberentes is pretty easy to configure, it is prone to problems, especailly if you do it on vagrant. So let's check which tools we can use, to monitor it:

Firstly we can get a component using the get command:

Get a component

As you can see, we have 2 failing pods, but we don't know why. This is where the “describe” command comes to place:

Describe a resource

But even that, doesn't show us so much. So what, we can do. Well we can troubleshoot :)

Firstly, let's check the logs:

Check logs

Well, that is specific issue to Vagrant configuration. The problem here is the fact that, the vagrant is using 10.0.2.15 IP as default IP, well that isn't the IP which you want for your kubernetes' API. So, the solution for that is to, edit the: /etc/systemd/system/kubelet.service.d/10-kubeadm.conf, by adding the following:

Edit Kubelete config

After that, we have to restart the kubelete using one of the following commands, (guess which one)

Kubelete Commands

But to be honest, better restart the whole Kubernetes :) After that all should be running under the correct IPs:

Check Kubernetes

Specific Problems

Let's dwelves into more specific problems:

Wrong Api Version

If you have a wrong Api version in teh YML file, you will receive the following error:

Wrong API Version

To fix that, find where that image has been moved, most probably for newer versions of Kubernetes is:

Correct API Version for nginx

Bare in mind that can of course change.

Not installed NFS Client (NFS Dynamic Provisioning)

In case you have NFS dynamic provisioning and you didn't install NFS client on ALL nodes of the cluster, you will get the following error, when you try to create a POD which is to be placed there.

Error with NFS client

To fix that, just install the NFS client on all the nodes:

Instgall NFS Client on Ubuntu

Instgall NFS Client on Centos