View on GitHub

learning-cloud-k8s

Notes and steps documented while learning k8s

Go To Home

Go To Previous Step (Minikube Setup)

Setup kubectl on Ubuntu

Machine environment

Local environment might matter for some shell commands

Setup steps

All commands mentioned in the guide are executed inside post doing SSH into AWS EC2 ubuntu instance

  1. Download and install kubectl
    curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl"
    
  2. Validate binary
    curl -LO "https://dl.k8s.io/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl.sha256"
    echo "$(<kubectl.sha256) kubectl" | sha256sum --check
    
    • output
      kubectl: OK
      
  3. Install kubectl
    sudo install -o root -g root -m 0755 kubectl /usr/local/bin/kubectl
    
  4. Check that it is working fine
    kubectl version --client