1

I've updated kubectl client version to the latest but I am not able to update kubectl server version to the latest due to which client and server versions are different. The problem is: how can I update kubectl server version?

P.S i'm running minikube on docker locally

Server Version: version.Info{Major:"1", Minor:"18", GitVersion:"v1.18.0", GitCommit:"9e991415386e4cf155a24b1da15becaa390438d8", GitTreeState:"clean", BuildDate:"2020-03-25T14:50:46Z", GoVersion:"go1.13.8", Compiler:"gc", Platform:"linux/amd64"}
WARNING: version difference between client (1.22) and server (1.18) exceeds the supported minor version skew of +/-1 ``` 



```commands which i used to update Kubectl client version are below (for mac intel chip):
Link reference: https://kubernetes.io/docs/tasks/tools/install-kubectl-macos/ ```
Wytrzymały Wiktor
  • 11,492
  • 5
  • 29
  • 37
MuhammadSannan
  • 109
  • 3
  • 15
  • Did you check [this answer](https://stackoverflow.com/questions/45002364/how-to-upgrade-minikube/64362273#64362273)? – Mikolaj S. Nov 12 '21 at 16:31

1 Answers1

1

Posted community wiki answer for better visibility. Feel free to expand it.


You need to upgrade your minikube version in order to upgrade the kubectl server version.

Based on this answer to upgrade minikube on macOS you just need to run these commands (since 2020):

brew update
brew upgrade minikube

If you encountered any problems, I'd suggest to fully delete minikube from your system (based on this GitHub page):

minikube stop; minikube delete &&
docker stop $(docker ps -aq) &&
rm -rf ~/.kube ~/.minikube &&
sudo rm -rf /usr/local/bin/localkube /usr/local/bin/minikube &&
launchctl stop '*kubelet*.mount' &&
launchctl stop localkube.service &&
launchctl disable localkube.service &&
sudo rm -rf /etc/kubernetes/ &&
docker system prune -af --volumes

Then you can install minikube with the newest version from scratch by using brew:

brew install minikube

either by downloading and installing a binary file:

curl -LO https://storage.googleapis.com/minikube/releases/latest/minikube-darwin-amd64
sudo install minikube-darwin-amd64 /usr/local/bin/minikube
Mikolaj S.
  • 2,850
  • 1
  • 5
  • 17
  • Hi @MuhammadSannan, if you find my answer helpful, please consider [up-voting / accepting it](https://stackoverflow.com/help/someone-answers). – Mikolaj S. Nov 25 '21 at 13:40