install kubectl on ubuntu

Kubectl is a command line tool used for interacting with Kubernetes clusters. You can access
different information about the cluster. If you have an Ubuntu Operating system then you need to install the Kubectl and then interact with the Kubernetes Clusters

In this post, we will learn how to install Kubectl on Ubuntu 22.04

Update the Ubuntu

sudo apt update

You should always update your Ubuntu Operating system before installing any software. This helps you to get the latest updates.

Install Kubectl cli

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

The Curl command is a CLI tool for transferring data from a URL

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

Download the Kubectl checksum file

echo "$(cat kubectl.sha256) kubectl" | sha256sum --check

The above command should return the below output

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

Open a new terminal to load the Kubectl CLI tool and then run the below command

kubectl

References

Next: Install Minikube on Ubuntu

One thought on “Install Kubectl on Ubuntu 22”

Leave a Reply

Your email address will not be published. Required fields are marked *