install-k8s-on-ubuntu-2204/install-kubectl.sh
Eliezer Croitoru 69b22cbf0d 3
2024-01-27 17:52:52 +00:00

32 lines
1.0 KiB
Bash
Executable File

#!/usr/bin/env bash
export DEBIAN_FRONTEND=noninteractive
apt install -y apt-transport-https ca-certificates curl wget
mkdir -p bin
wget "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl" \
-O ./bin/kubectl
wget "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl.sha256" \
-O ./bin/kubectl.sha256
echo "$(cat ./bin/kubectl.sha256) ./bin/kubectl" | sha256sum --check
install -o root -g root -m 0755 ./bin/kubectl /usr/local/bin/kubectl
kubectl version --client
wget "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl-convert" \
-O ./bin/kubectl-convert
wget "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl-convert.sha256" \
-O ./bin/kubectl-convert.sha256
echo "$(cat ./bin/kubectl-convert.sha256) ./bin/kubectl-convert" | sha256sum --check
install -o root -g root -m 0755 ./bin/kubectl-convert /usr/local/bin/kubectl-convert