Friday, February 2, 2024

How to Install kubectl cli on Ubuntu Linux

 How to Install kubectl cli on Ubuntu Linux

Kubectl is a command line tool used for interacting with kubernetes cluster. You can access different information about the cluster.


In this post we will learn how to install kubectl on ubuntu 22.04

Update the system

sudo apt update

Install kubectl cli

curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl"

Download kubectl checksum file

curl -LO "https://dl.k8s.io/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl.sha256"
echo "$(cat kubectl.sha256) kubectl" | sha256sum --check

Above command should return below output

kubectl: OK

sudo install -o root -g root -m 0755 kubectl /usr/local/bin/kubectl

Open new terminal to load the kubectl cli tool and then run below command

kubectl

No comments:

Post a Comment