Thursday 23 June 2022

Install kubectl binary with curl on Linux


Ref:- kubernetes.io

#Download the latest release with the command

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

  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current

                                 Dload  Upload   Total   Spent    Left  Speed

100   154  100   154    0     0   1132      0 --:--:-- --:--:-- --:--:--  1132

100 43.5M  100 43.5M    0     0  23.1M      0  0:00:01  0:00:01 --:--:-- 32.9M


#Download the kubectl checksum file

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

  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current

                                 Dload  Upload   Total   Spent    Left  Speed

100   154  100   154    0     0   1193      0 --:--:-- --:--:-- --:--:--  1193

100    64  100    64    0     0    156      0 --:--:-- --:--:-- --:--:--   284


#Validate the kubectl binary against the checksum file

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

kubectl: OK


#Install kubectl

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

chmod +x kubectl


ls -la kubectl*

-rwxrwxr-x 1 devops devops 45711360 Jun 22 18:13 kubectl

-rw-rw-r-- 1 devops devops       64 Jun 22 18:15 kubectl.sha256


mkdir -p ~/.local/bin

mv ./kubectl ~/.local/bin/kubectl


kubectl version --client

WARNING: This version information is deprecated and will be replaced with the output from kubectl version --short.  Use --output=yaml|json to get the full version.

Client Version: version.Info{Major:"1", Minor:"24", GitVersion:"v1.24.2", GitCommit:"f66044f4361b9f1f96f0053dd46cb7dce5e990a8", GitTreeState:"clean", BuildDate:"2022-06-15T14:22:29Z", GoVersion:"go1.18.3", Compiler:"gc", Platform:"linux/amd64"}

Kustomize Version: v4.5.4


Install minikube




No comments:

Post a Comment