Skip to content

Instantly share code, notes, and snippets.

@khyurri
Last active January 20, 2022 11:12
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save khyurri/3b870a6c6b72bd6eecd080020435064c to your computer and use it in GitHub Desktop.
Save khyurri/3b870a6c6b72bd6eecd080020435064c to your computer and use it in GitHub Desktop.
kubectl on AWS Cloud Shell

Doc: https://docs.aws.amazon.com/eks/latest/userguide/install-kubectl.html

curl -o kubectl https://amazon-eks.s3.us-west-2.amazonaws.com/1.21.2/2021-07-05/bin/linux/amd64/kubectl
chmod +x ./kubectl
mkdir -p $HOME/bin && cp ./kubectl $HOME/bin/kubectl && export PATH=$PATH:$HOME/bin
echo 'export PATH=$PATH:$HOME/bin' >> ~/.bashrc
kubectl version --short --client

Setup EKS

aws eks --region us-west-2  update-kubeconfig --name sandbox

Usefull commands

On error like CreateContainerConfigError

kubectl describe pod pod_name

To run commands from running container

kubectl get pod pod_name
kubectl exec --stdin --tty pod_name -- /bin/bash
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment