Home > other >  Fix kubectl version skew
Fix kubectl version skew

Time:08-13

I want to fix version difference between client (1.21) and server (1.24).
1.21 version for client is desired version.
So version for server shall be decreased.

$ kubectl version --short  
Client Version: v1.21.14  
Server Version: v1.24.3  
WARNING: version difference between client (1.21) and server (1.24) exceeds the supported minor version skew of  /-1  

CodePudding user response:

you should update the client version, and keep multiple version of kubectl base on the cluster. or if you are going to decrease version of kubectl server then consider the comment, which i do not think what you will need.

you can use enter image description here

to use kubectl from asdf run this for zsh, as you might be using kubectl from other source

echo -e "\n. $(brew --prefix asdf)/libexec/asdf.sh" >> ${ZDOTDIR:-~}/.zshrc

getting-started-shell

or you can checklist of all available version

asdf list all kubectl

CodePudding user response:

I could solved the issue thanks to larsks's advice.

I uninstalled latest version and installed v1.23.2 of minikube.
Then kubernetes server version v1.22.2 was intalled.

Not only stop minikube but also delete it is needed to overwrite it's version.

$ minikube stop
$ minikube delete
$ curl -LO https://storage.googleapis.com/minikube/releases/v1.23.2/minikube-linux-amd64
$ sudo install minikube-linux-amd64 /usr/local/bin/minikube
$ kubectl version --short
Client Version: v1.21.14
Server Version: v1.22.2

WARNING disappeared.

Refference

  • Related