kubectl version showing the wrong version number kubectl version showing the wrong version number kubernetes kubernetes

kubectl version showing the wrong version number


This is happening because windows always give you the first comment found in the PATH, both kubectl versions (Docker and yours) are in the PATH but Docker PATH in being referenced before your kubectl PATH.

To solve this really depends on what you need. If you are not using your Docker Kubernetes you have two alternatives:

1 - Fix your PATH and make sure that your kubectl PATH is referenced before Docker PATH.

2 - Replace Docker kubectl to yours.

3- Make sure you restart your PC after doing these changes, as kubectl will automatically update the configuration to point to the newer kubectl version the next time you use the minikube start command with a correct --kubernetes-version:

If you are using both from time to time, I would suggest you to create a script that will change your PATH according to your needs.

According to the documentation you must use a kubectl version that is within one minor version difference of your cluster. For example, a v1.2 client should work with v1.1, v1.2, and v1.3 master. Using the latest version of kubectl helps avoid unforeseen issues.