While setting kubernetes cluster, kubeadm initialization command is giving error

9/21/2018

I am trying to setup Kubernetes cluster on Azure ubuntu-16.04 LTS VM. I installed docker 17.03.2~ce-0~ubuntu-xenial version on VM and followed all steps mentioned on kubernetes official website but while running kubeadm command on my master node I am getting error.

My init command:

 kubeadm init --pod-network-cidr=10.244.0.0/16 --apiserver-advertise-address=<ip>

Error Message:

[init] using Kubernetes version: v1.11.3
[preflight] running pre-flight checks
[preflight] Some fatal errors occurred:
    [ERROR KubeletVersion]: the kubelet version is higher than the control 
plane version. This is not a supported version skew and may lead to a 
malfunctional cluster. Kubelet version: "1.12.0-rc.1" Control plane version: 
"1.11.3"
[preflight] If you know what you are doing, you can make a check non-fatal 
with `--ignore-preflight-errors=...`
-- user3541321
azure
azure-vm-templates
docker
kubernetes

2 Answers

10/2/2018

The error you have posted is definitely related to what @Rico described, there was a version update lately, and many people had this issue (including me). You can see the releases here. Seems like some time after the release of the new version, the apt-get install -y kubelet kubeadm kubectl would download or match the incorrect version of components.

When I had this issue, downloading the Kubernetes version manually ( kubeadm config images pull --kubernetes-version v1.11.3) and then running kubeadm init with a flag marking which version I want to run worked for me. Another option is to upgrade kubeadm (apt-get upgrade kubeadm).

However, as I tested this on clean install just a few minutes ago, everything works fine out of the box.

You can remove the kubelet, kubeadm, and kubectl and install them again with the recommended commands from the documentation or try kubeadm reset and then match the versions or update components as proposed by Rico. Do not forget to run:

mkdir -p $HOME/.kube sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config sudo chown $(id -u):$(id -g) $HOME/.kube/config

after cluster initialization.

-- aurelius
Source: StackOverflow

9/21/2018

You have a newer version of the kubelet - v1.12.0-rc.1 than that of kubeadm - v1.11.3. You can try:

  1. Downgrading the kubelet to match your kubeadm version

    On Ubuntu run: apt-get -y install kubelet=1.11.3-00

  2. The other way around, upgrade kubeadm to match that of the kubelet

    On Ubuntu run: apt-get -y install kubeadm=1.12.0-rc.1-00

  3. --ignore-preflight-errors like it says, but watch if you see any other errors that may make your installation not work.

Hope it helps.

-- Rico
Source: StackOverflow