Skip to content

Instantly share code, notes, and snippets.

@v0lkan
Created September 3, 2022 06:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save v0lkan/5da4bc653bc31bd3a7105b878328d304 to your computer and use it in GitHub Desktop.
Save v0lkan/5da4bc653bc31bd3a7105b878328d304 to your computer and use it in GitHub Desktop.
Install `kubectl` to Amazon EC2 Linux
# 1. Get the latest kubectl version:
curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl"
# 2. Get checksum
curl -LO "https://dl.k8s.io/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl.sha256"
# 3. Validate
echo "$(<kubectl.sha256) kubectl" | sha256sum --check
# should output: “kubectl: OK”
# 4. Insall
sudo install -o root -g root -m 0755 kubectl /usr/local/bin/kubectl
# 5. Verify
kubectl version --client --output=yaml
# clientVersion:
# buildDate: "2022-08-23T17:44:59Z"
# compiler: gc
# … etc.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment