Bootstrap FreeKB - Kubernetes - Install the kubectl CLI on Linux
Kubernetes - Install the kubectl CLI on Linux

Updated:   |  Kubernetes articles

On a Linux system, a GET request can be issued to https://storage.googleapis.com/kubernetes-release/release/<version>/bin/linux/amd64/kubectl to download the kubectl CLI.

For example, the following curl command can be used to download version 1.23.6 of kubectl to your present working directory.

curl --location --remote-name https://storage.googleapis.com/kubernetes-release/release/v1.23.6/bin/linux/amd64/kubectl

 

The aws eks list-clusters command can be used to list your Elastic Kubernetes Service (EKS).

~]$ aws eks list-clusters
{
    "clusters": [
        "my-cluster"
    ]
}

 

And then the aws eks update-kubeconfig command can be used to create or update your hidden .kube/config file. By default, the hidden .kube config file will be created at /home/your_username/.kube/config.

~]$ aws eks update-kubeconfig --name my-cluster
Added new context arn:aws:eks:us-east-1:123456789012:cluster/my-cluster to /home/john.doe/.kube/config

 

You can now try to use kubectl. I would first try the kubectl version command. I wouldn't be surprised if you get a warning that the version of kubectl does not match your Kubernetes version.

]$ kubectl version
Client Version: version.Info{Major:"1", Minor:"23", GitVersion:"v1.23.6", GitCommit:"ad3338546da947756e8a88aa6822e9c11e7eac22", GitTreeState:"clean", BuildDate:"2022-04-14T08:49:13Z", GoVersion:"go1.17.9", Compiler:"gc", Platform:"linux/amd64"}

Server Version: version.Info{Major:"1", Minor:"27+", GitVersion:"v1.27.6-eks-f8587cb", GitCommit:"b6911bf9eade7d8ca7dd82af5e80626965829947", GitTreeState:"clean", BuildDate:"2023-09-18T22:12:19Z", GoVersion:"go1.20.8", Compiler:"gc", Platform:"linux/amd64"}

WARNING: version difference between client (1.23) and server (1.27) exceeds the supported minor version skew of +/-1

 




Did you find this article helpful?

If so, consider buying me a coffee over at Buy Me A Coffee



Comments


Add a Comment


Please enter aeb8e6 in the box below so that we can be sure you are a human.