Tuesday, May 26, 2020

How to install kubectl on Linux | Install kubectl on Amazon Linux / Red Hat Linux

Kubernetes uses a command line utility called kubectl for communicating with the cluster API server.

Download Amazon EKS-vended kubectl binary from Amazon S3
curl -o kubectl https://s3.us-west-2.amazonaws.com/amazon-eks/1.22.6/2022-03-09/bin/linux/amd64/kubectl

Apply execute permissions to the binary
chmod +x ./kubectl

Copy binary into a folder and add to path
mkdir -p $HOME/bin && cp ./kubectl $HOME/bin/kubectl && export PATH=$PATH:$HOME/bin

Add the $HOME/bin path to your shell initialization file so that it is configured when you open a shell.
echo 'export PATH=$PATH:$HOME/bin' >> ~/.bashrc

Verify if kubectl got installed
kubectl version --short --client

Client Version: v1.22.6-eks-7d68063

No comments:

Post a Comment