1

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  
Ryo Matsuzaka
  • 135
  • 1
  • 1
  • 9
  • 2
    Then you will need to tear down your kubernetes servers and re-install them using the earlier version of kubernetes. – larsks Aug 13 '22 at 11:56
  • Does this answer your question? [version difference between client (1.24) and server (1.20) exceeds the supported minor version skew of +/-1](https://stackoverflow.com/questions/72760471/version-difference-between-client-1-24-and-server-1-20-exceeds-the-supported) – Blender Fox Aug 15 '22 at 07:29

2 Answers2

1

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 asdf tool version manager, almost a similar tool like tfswitch.

For mac

brew install asdf

Manage multiple runtime versions with a single CLI tool

getting-started or install-asdf

asdf plugin-add kubectl
asdf install kubectl 1.24.3
asdf global kubectl 1.24.3
asdf list kubectl
#already installed list
#1.21.3
#1.23.3
#1.24.3
source ~/.zshrc

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
Adiii
  • 54,482
  • 7
  • 145
  • 148
1

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

Ryo Matsuzaka
  • 135
  • 1
  • 1
  • 9