Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Downgrade kubectl version to match minikube k8s version

Tags:

I started minikube with k8s version 1.5.2 and I would like to downgrade my kubectl so that it is also 1.5.2. Currently when I run kubectl version I get:

Client Version: version.Info{Major:"1", Minor:"7", GitVersion:"v1.7.5", GitCommit:"17d7182a7ccbb167074be7a87f0a68bd00d58d97", GitTreeState:"clean", BuildDate:"2017-08-31T19:32:12Z", GoVersion:"go1.9", Compiler:"gc", Platform:"darwin/amd64"} Server Version: version.Info{Major:"1", Minor:"5", GitVersion:"v1.5.2", GitCommit:"08e099554f3c31f6e6f07b448ab3ed78d0520507", GitTreeState:"clean", BuildDate:"1970-01-01T00:00:00Z", GoVersion:"go1.7", Compiler:"gc", Platform:"linux/amd64"} 

I would like to use kubectl to fetch PetSets but in later versions this was updated to StatefulSets so I cannot use the commands with my current kubectl version

kubectl get petsets the server doesn't have a resource type "petsets" 

Thanks!

like image 921
appdap1 Avatar asked Oct 06 '17 16:10

appdap1


People also ask

Can I use kubectl with minikube?

You can use the kubectl command to deploy a test application to your Minikube cluster.

How do I check my minikube k8s version?

Once your minikube is running, you can use kubectl version command to see the version of kubernetes server. Also, when you start minikube using minikube start , kubernetes version is shown in stdout. $ minikube start Starting local Kubernetes v1. 6.0 cluster...

What is the latest version of minikube?

Version 1.26. 1 - 2022-08-02. Minor Improvements: Check for cri-dockerd & dockerd runtimes when using none-driver on Kubernetes 1.24+ #14555.


1 Answers

You can just download the previous version binary and replace the one you have now.

Linux:

curl -LO https://storage.googleapis.com/kubernetes-release/release/v1.5.2/bin/linux/amd64/kubectl chmod +x ./kubectl sudo mv ./kubectl /usr/local/bin/kubectl 

macOS:

curl -LO https://storage.googleapis.com/kubernetes-release/release/v1.5.2/bin/darwin/amd64/kubectl chmod +x ./kubectl sudo mv ./kubectl /usr/local/bin/kubectl 

Windows:

curl -LO https://storage.googleapis.com/kubernetes-release/release/v1.5.2/bin/windows/amd64/kubectl.exe 

And add it to PATH.

If not follow instructions for other Operating Systems here: https://kubernetes.io/docs/tasks/tools/install-kubectl/#install-kubectl-binary-via-curl

like image 158
vascop Avatar answered Oct 11 '22 13:10

vascop