Welcome to the Linux Foundation Forum!

Getting error when first initializing Kubernetes on new Machines

Exercise 3.1 Install Kubernetes

Step 15 kubeadm init --config=kubeadm-config.yaml --upload-certs | tee kubeadm-init.out # Save output for future reviewn throws error:

this version of kubeadm only supports deploying clusters with the control plane version >= 1.21.0. Current version: v1.20.0

Additional Information:

  • Using AWS with Ubuntu 20.04 (fresh machines, newly upgraded)
  • Using cri-o
  • Installed kube-commands with apt-get install -y kubeadm=1.22.2-00 kubelet=1.22.2-00 kubectl=1.22.1-00
  • no file /etc/kubernetes/admin.conf present

Verbose output (v=5) does not reveal any relevant output

There was never a version v1.20.0 installed on the system. So where does kubeadm take the information from?

What can I do to make it work?

Answers

  • tholman
    tholman Posts: 2

    I'm getting a similar issue. Kubelet version is higher than the control plane version. kubelet = 1.23.1 and control plane = 1.21.1

    The command I used came straight from the documentation:

    apt-get install -y \kubeadm=1.21.1-00 kubelet=1.21.1-00 kubectl=1.21.1-00

  • tholman
    tholman Posts: 2

    I fixed this by uninstalling the kubelet version and re-installing it. Note I had to remove the -y flag from the initial command in order for the kubelet to be "downgraded":
    apt-get install \kubeadm=1.21.1-00 kubelet=1.21.1-00 kubectl=1.21.1-00

    original command with the -y flag:

    apt-get install -y \kubeadm=1.21.1-00 kubelet=1.21.1-00 kubectl=1.21.1-00

  • joov
    joov Posts: 8

    Tried apt remove and then apt installagain. Did not help unfortunately.

  • chrispokorni
    chrispokorni Posts: 1,417

    Hi @joov,

    Chapter 3 instructs us to install Kubernetes version 1.21.1, and then in chapter 4 the cluster is upgraded to version 1.22.1.

    For recommended AWS EC2 instance sizing, VPC networking, SG rules configuration, and guest OS, please watch the AWS set up video from the first chapter.

    Regards,
    -Chris

  • sdragnia
    sdragnia Posts: 2
    edited January 31

    If installing using cri-o
    I found the config file kubeadm-crio.yaml has at line 31:
    kubernetesVersion: 1.20.0
    changing for kubernetesVersion: 1.21.1 worked for me

Categories

Upcoming Training