Issue in launching minikube on mac

12/17/2019

I am new to Kubernetes. I am trying to launch a kubernetes cluster in my local mac machine. I am using following command to launch Kubernetes:

minikube start --vm-driver=hyperkit

I am getting following error:

/usr/local/bin/kubectl is version 1.14.7, and is incompatible with Kubernetes 1.17.0. 
You will need to update /usr/local/bin/kubectl or use 'minikube kubectl' to connect with this cluster

Now while executing following command:

minikube kubectl

It is not doing anything, just showing basic commands along with their usages.

And while trying to upgrade kubetctl it is showing it is already up to date.

I have not found any solution for this. Any idea regarding how to fix this ?

-- Joy
kubernetes
minikube

4 Answers

5/10/2020

Matching both the client and server versions fixed issue,

➜  ~ kubectl version
Client Version: version.Info{Major:"1", Minor:"15", GitVersion:"v1.15.5", GitCommit:"20c265fef0741dd71a66480e35bd69f18351daea", GitTreeState:"clean", BuildDate:"2019-10-15T19:16:51Z", GoVersion:"go1.12.10", Compiler:"gc", Platform:"darwin/amd64"}
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"}

Client version: v1.15.5

Server version: v1.18.0

So update client version using,

➜  ~ curl -LO https://storage.googleapis.com/kubernetes-release/release/<version-here>/bin/darwin/amd64/kubectl

for installing v1.18.0,

➜  ~ curl -LO https://storage.googleapis.com/kubernetes-release/release/v1.18.0/bin/darwin/amd64/kubectl

then,

  1. ➜ ~ chmod +x ./kubectl
  2. ➜ ~ sudo mv ./kubectl $(which kubectl)

Now check version,

➜  ~ kubectl version
Client Version: version.Info{Major:"1", Minor:"18", GitVersion:"v1.18.0", GitCommit:"9e991415386e4cf155a24b1da15becaa390438d8", GitTreeState:"clean", BuildDate:"2020-03-25T14:58:59Z", GoVersion:"go1.13.8", Compiler:"gc", Platform:"darwin/amd64"}
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"}
-- Nishant Nawarkhede
Source: StackOverflow

12/17/2019

The best solution for you is to update kubectl manually. To perform this you need to download the binary:

https://storage.googleapis.com/kubernetes-release/release/v1.17.0/bin/darwin/amd64/kubectl

Change permissions of kubectl to be executable:

$ chmod +x ./kubectl 

And move to /usr/local/bin/ overwriting the old one.

$ sudo mv ./kubectl $(which kubectl)

To check the effects, run:

$ kubectl version
-- mWatney
Source: StackOverflow

1/14/2020

If you have already upgraded and got the same error, try below

brew link --overwrite kubernetes-cli
-- erncnerky
Source: StackOverflow

12/17/2019

Best choice to upgrade your minikube, (and kubernetes-cli). Current latest releases of kubectl is 1.17.0, and minikube 1.6.1.

brew upgrade minikube
brew upgrade kubernetes-cli

Other option will be to run specific version of kubernetes in minikube.

minikube start --vm-driver=virtualbox --kubernetes-version=1.14.7

Similar error message I got while using kubectl 1.17 against kubernetes installed with --kubernetes-version=1.14.7

/usr/local/bin/kubectl is version 1.17.0, and is incompatible with Kubernetes 1.14.7. You will need to update /usr/local/bin/kubectl or use 'minikube kubectl' to connect with this cluster
-- Oleg Butuzov
Source: StackOverflow