Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to upgrade kubectl client version

I want to upgrade the kubectl client version to 1.11.3.

I executed brew install kubernetes-cli but the version doesnt seem to be updating.

Client Version: version.Info{Major:"1", Minor:"10", GitVersion:"v1.10.7", GitCommit:"0c38c362511b20a098d7cd855f1314dad92c2780", GitTreeState:"clean", BuildDate:"2018-08-20T10:09:03Z", GoVersion:"go1.9.3", Compiler:"gc", Platform:"darwin/amd64"} Server Version: version.Info{Major:"1", Minor:"11", GitVersion:"v1.11.4", GitCommit:"bf9a868e8ea3d3a8fa53cbb22f566771b3f8068b", GitTreeState:"clean", BuildDate:"2018-10-25T19:06:30Z", GoVersion:"go1.10.3", Compiler:"gc", Platform:"linux/amd64"} 

I'm trying to get the logs for a cell by running this command.

kubectl logs -l groupname/cell=my-cell --all-containers=true 

This works in my VM which has client version 1.11.3. But in my mac it gives me an error saying --all-containers=true flag is not available for kubectl logs command.

like image 213
Madhuka Wickramapala Avatar asked Dec 10 '18 07:12

Madhuka Wickramapala


People also ask

How do I update kubectl?

To install or update kubectl on WindowsDownload the kubectl binary for your cluster's Kubernetes version from Amazon S3. (Optional) Verify the downloaded binary with the SHA-256 sum for your binary. Download the SHA-256 sum for your cluster's Kubernetes version for Windows.

How do I check my kubectl client version?

The simplest way of checking a cluster's Kubernetes version is to use the kubectl version command. This command will output information for the kubectl client and the Kubernetes cluster. The Server Version is the version of Kubernetes your cluster is running.

What is kubectl client and server version?

Regardless of where you install it kubectl is the client tool to interact with the Kubernetes API Server. Server version depends on what version of the kubernetes software was used while setting up the Kubernetes Cluster and downgrade/upgrade process depends on the tool used to set it up as well.


1 Answers

Install specific version of kubectl

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

For your case if you want to install version v1.11.3 then replace specific-kubectl-version with v1.11.3

Then make this binary executable

chmod +x ./kubectl 

Then move this binary to your PATH

sudo mv ./kubectl $(which kubectl) 
like image 117
Abu Hanifa Avatar answered Sep 29 '22 02:09

Abu Hanifa