[ERROR KubeletVersion]: the kubelet version is higher than the control plane version - kubernetes

I'm new to kubernetes and I'm setting up my first testing cluster. However, I'll get this error when I set up the master node. But I'm not sure how to fix it.
[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"
The host is fully patched to the latest levels
CentOS Linux release 7.5.1804 (Core)
Many Thanks
S

I hit the same problem and used the kubeadm option: --kubernetes-version=v1.12.0-rc.1
sudo kubeadm init --pod-network-cidr=172.16.0.0/12 --kubernetes-version=v1.12.0-rc.1
I'm using a JVM image that was prepared a few weeks ago and have just updated the packages. Kubeadm, kubectl and kubelet all now return version v1.12.0-rc.1 when asked but when 'kubeadm init' is called it kicks off with the previous version.
[init] using Kubernetes version: v1.11.3
specifying the (control plane) version did the trick.

Install the same version of kubelet & kubeadm
yum -y remove kubelet
yum -y install kubelet-1.11.3-0 kubeadm-1.11.3-0

I'm getting the same error on a clean Centos 7 install after fully updating with yum update, and then applying the instructions from https://kubernetes.io/docs/setup/independent/install-kubeadm/ for setup.
Adding the option for --ignore-preflight-errors=KubeletVersion allows the installer to continue but the installation is non-working afterwards.
I was able to remove everything and reinstall matching versions with the following:
yum -y remove kubelet kubeadm kubectl
yum install -y --disableexcludes=kubernetes kubeadm-1.11.3-0.x86_64 kubectl-1.11.3-0.x86_64 kubelet-1.11.3-0.x86_64

Related

dask-getway on K8s using helm3: Error: failed to install CRD crds/daskclusters.yaml

I'm following the instructions to setup Dask on K8s Cluster. I'm on MacOS, have K8s running on Docker Desktop, kubectl version 1.22.5 and helm version 3.8.0. After adding the repository, downloading default configuration, installing helm chart using command
RELEASE=my-dask-gateway
NAMESPACE=dask-gateway
VERSION=0.9.0
helm upgrade --install \
--namespace $NAMESPACE \
--version $VERSION \
--values path/to/your/config.yaml \
$RELEASE \
dask/dask-gateway
generates following output/error
"dask" already exists with the same configuration, skipping
Hang tight while we grab the latest from your chart repositories...
...Successfully got an update from the "dmwm-bigdata" chart repository
...Successfully got an update from the "dask" chart repository
Update Complete. ⎈Happy Helming!⎈
Release "my-dask-gateway" does not exist. Installing it now.
Error: failed to install CRD crds/daskclusters.yaml: unable to recognize "": no matches for kind "CustomResourceDefinition" in version "apiextensions.k8s.io/v1beta1"
An older post suggests to either update the manifest or use older version of kubernetes. Does that mean dask is not compatible with recent versions of kubernetes?
Posting community wiki answer for better visibility:
This is fixed in the repo main. You could grab the CRDs from there, or wait for a release, which we are hoping to do soon. Otherwise, yes, you would need an older version of kubernetes for dask-gateway to work.

microk8s - helm3 / function "lookup" not defined

I recently installed microk8s, and enabled helm3 and dns addons on microk8s.
Deployment from stable/chart works fine but any deployment from bitnami/chart fails.
OS: Ubuntu 20.04.1 LTS -- microk8s: 1.19/stable
microk8s.helm3 install my-release bitnami/jenkins
=> Error: parse error at (jenkins/charts/common/templates/_secrets.tpl:84): function "lookup" not defined
microk8s.helm3 install my-release bitnami/magento
=> Error: parse error at (magento/charts/elasticsearch/charts/common/templates/_secrets.tpl:84): function "lookup" not defined
There was a bug reported here and here which was caused by the conditional inclusion of lookup into the function map.
A fix for it was merged here and is now available from Helm version 3.2.0.
So, in order to fix this issue you should update your Helm to version 3.2.0 or newer.
Faced with the same issue while installing Kafka. The solution is to install a newer version of Helm 3 and use its commands with --kubeconfig specified:
microk8s config > kubeconfig.yaml
sudo snap install helm --classic
/snap/bin/helm repo add bitnami https://charts.bitnami.com/bitnami
/snap/bin/helm install --wait kafka bitnami/kafka --set metrics.jmx.enabled=true --kubeconfig kubeconfig.yaml
Try to install helm3 with snap and then link it to microk8s:
sudo snap install helm --classic
sudo mkdir /var/snap/microk8s/current/bin
sudo ln -s /snap/bin/helm /var/snap/microk8s/current/bin/helm
There seems to be some issues using helm3.0 instead of helm 3.1
thanks for all of the information
I fixed this by using the snap helm (version 3.6.3) on ubuntu
microk8s config > ~/.kube/config
chmod go-r ~/.kube/config
sudo snap install helm --classic
then doing the helm repo add, update, and install charts without errors

kubeadm throws "command not found" error. What to do?

I am new to kubernetes. I have kubenetes and kubelet installed on my linux (RHEL7) system. I want to get kubeadm on my system, but due to the organization's policy, I can't install it via yum or ap-get, etc.
Now, I am trying to find the kubeadm rpm file, which is compatible for my Redhat linux system. This I can install on the system. i found the rpm files here but after running it the following error shows:
"error: kubernetes-kubeadm-1.10.3-1.fc29.ppc64le.rpm: not an rpm package" for every rpm file.
How do I solve this? Or are these files compatible with Fedora instead?
You can find links to the official packages for all OSes included RHEL 7 on the docs page: https://kubernetes.io/docs/setup/independent/install-kubeadm/
cat <<EOF > /etc/yum.repos.d/kubernetes.repo
[kubernetes]
name=Kubernetes
baseurl=https://packages.cloud.google.com/yum/repos/kubernetes-el7-x86_64
enabled=1
gpgcheck=1
repo_gpgcheck=1
gpgkey=https://packages.cloud.google.com/yum/doc/yum-key.gpg https://packages.cloud.google.com/yum/doc/rpm-package-key.gpg
exclude=kube*
EOF
# Set SELinux in permissive mode (effectively disabling it)
setenforce 0
sed -i 's/^SELINUX=enforcing$/SELINUX=permissive/' /etc/selinux/config
yum install -y kubelet kubeadm kubectl --disableexcludes=kubernetes
systemctl enable kubelet && systemctl start kubelet
As pointed by #code-ranger, you can download packages from kubernetes repo, and the way to do that is:
The following link is the xml file which lists all the packages for kubernetes:
https://packages.cloud.google.com/yum/repos/kubernetes-el7-x86_64/repodata/primary.xml
This has list of all the packages present in kubernetes, search for kubeadm and you will find something like:
This gives you a link to the rpm package -kubeadm- and you can use that link as follows:
https://packages.cloud.google.com/yum/pool/5af5ecd0bc46fca6c51cc23280f0c0b1522719c282e23a2b1c39b8e720195763-kubeadm-1.13.1-0.x86_64.rpm
Note: This links expire in few weeks or days and new strings generated, so it would be good if you download your rpm locally instead of using link directly.
In similar fashion, you can download other packages like kubelet,kubectl etc.
Hope this helps.

Helm: Incompatible versions between client and server

After I have run helm list I got following error:
Error: incompatible versions client[v2.9.0] server[v2.8.2]
I did a helm init to install the compatible tiller version
"Warning: Tiller is already installed in the cluster.
(Use --client-only to suppress this message, or --upgrade to upgrade Tiller to the current version.)".
Any pointers?
Like the OP, I had this error:
$ helm list
Error: incompatible versions client[v2.10.0] server[v2.9.1]
Updating the server wasn't an option for me so I needed to brew install a previous version of the client. I hadn't previously installed client[v2.9.1] (or any previous client version) and thus couldn't just brew switch kubernetes-helm 2.9.1. I ended up having to follow the steps in this SO answer: https://stackoverflow.com/a/17757092/2356383
Which basically says
Look on Github for the correct kubernetes-helm.rb file for the version you want (2.9.1 in my case): https://github.com/Homebrew/homebrew-core/search?q=kubernetes-helm&type=Commits
Click the commit hash (78d6425 in my case)
Click the "View" button to see the whole file
Click the "Raw" button
And copy the url: https://raw.githubusercontent.com/Homebrew/homebrew-core/78d64252f30a12b6f4b3ce29686ab5e262eea812/Formula/kubernetes-helm.rb
Now that I had the url for the correct kubernetes-helm.rb file, I ran the following:
$ brew unlink kubernetes-helm
$ brew install https://raw.githubusercontent.com/Homebrew/homebrew-core/78d64252f30a12b6f4b3ce29686ab5e262eea812/Formula/kubernetes-helm.rb
$ brew switch kubernetes-helm 2.9.1
Hope this helps someone.
To upgrade your tiller version to the same version of the client, just run helm init --upgrade
NOTE: If you're trying to downgrade the server version to match your local client version, run the following instead:
helm init --upgrade --force-upgrade
Another alternative, if changing the server version is not an option, is to use the
helm installer script
The script lets you chose a specific version like so
./get_helm.sh -v v2.13.1
Another approach to using different versions through Docker.
https://hub.docker.com/r/alpine/helm
Example: list helm packages installed
docker run -it --rm \
-v ~/.kube/config:/root/.kube/config \
-v ~/.helm:/root/.helm alpine/helm:2.9.1 \
list
This is a long command; but it can be shortened with an alias
alias helm_2_9_1="docker run -ti --rm \
-v $(pwd):/apps -v ~/.kube/config:/root/.kube/config \
-v ~/.helm:/root/.helm alpine/helm:2.9.1"
And then the command is
helm_2_9_1 list
This answer is for who want to choose(downgrade) helm client version, and the brew install is not work.You can just manually install the binary file from here.
example:
you can unlink the current helm
brew unlink kubernetes-helm
choose and download the helm version you want in github helm------v2.8.2
unzip the file and put the helm unix executable binary file into /usr/local/bin directory
go to the directory you just downloaded
cd /Users/your_name/Downloads
unzip the file
gunzip -c helm-v2.8.2-darwin-amd64.tar.gz | tar xopf -
copy to the bin directory
cp darwin-amd64/helm /usr/local/bin
now you will see the right version of helm you want
helm version
For those having installed their helm client with snap, to downgrade/upgrade it to a specific version you can simply:
Uninstall it: snap remove helm
Check the available versions: snap info helm
Install the one you want: snap install helm --channel=X.X/stable --classic
This probably isn't the most advanced answer... but my team runs kubernetes clusters that already have tiller installed. While setting up a new laptop, I wanted my helm to match the tiller version, so I found it like this:
TILLER_POD=`kubectl get pods -n kube-system | grep tiller | awk '{print $1}'`
kubectl exec -n kube-system $TILLER_POD -- /tiller -version
Then I just used the normal helm install instructions from that release number (being on Linux, its basically just curl and unzip to /usr/local/bin).
If you are windows user and installed helm through choco, firstly go its folder (mine is C:\ProgramData\chocolatey) and delete helm.exe from bin folder.
Then, corresponding heml.exe file should be downloaded. By using the above comments, decide the location where you will download exe from. For instance, I used that path: https://get.helm.sh/helm-v2.14.3-windows-amd64.tar.gz
Finally extract the helm.exe from tar and move into choco bin folder. Of course, you can directly add this exe into the path.
I experienced same issue, but in my case I wanna only to upgrade Tiller to specific version (because helm client is running remotely).
So, error was:
Error: UPGRADE FAILED: incompatible versions client[v2.11.0] server[v2.9.1]
Accordingly to documentation I've run:
$ kubectl --namespace=kube-system set image deployments/tiller-deploy tiller=gcr.io/kubernetes-helm/tiller:v2.11.0
deployment.extensions/tiller-deploy image updated
Documentation reference:
https://helm.sh/docs/install/#upgrading-tiller

Kubernetes1.9.0 kubeadm init - crictl not found in system path

I am setting up kubernetes cluster on a Centos 7 machine, and the kubeadm init command gives me the below warning message.
[init] Using Kubernetes version: v1.9.0
[init] Using Authorization modes: [Node RBAC]
[preflight] Running pre-flight checks.
[WARNING SystemVerification]: docker version is greater than the most recently validated version. Docker version: 17.09.1-ce. Max validated version: 17.03
[WARNING FileExisting-crictl]: crictl not found in system path
How can I fix this crictl not found in system path warning? Do I need to install any additional software?
Yes, you need additional software. crictl is part of the cri-tools repo on github.
At least when I encountered this problem (Dec 20, 2017), cri-tools isn't available on kubernete's package repo, so I had to download source and build it. cri-tools is written in go, so you may need to install golang on your system as well.
I installed crictl with
go get github.com/kubernetes-incubator/cri-tools/cmd/crictl
If you don have go on your system, you could install crictl from
https://github.com/kubernetes-incubator/cri-tools/releases