Skip to content

Instantly share code, notes, and snippets.

@edib
Last active September 25, 2023 13:25
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 edib/4df7d98fca9e3e53bf532014d295442b to your computer and use it in GitHub Desktop.
Save edib/4df7d98fca9e3e53bf532014d295442b to your computer and use it in GitHub Desktop.
curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl"
sudo mv kubectl /usr/bin/
sudo chmod +x /usr/bin/kubectl
mkdir .kube
sudo cp /etc/kubernetes/admin.conf .kube/config
kubectl get node
@edib
Copy link
Author

edib commented Sep 25, 2023

@edib
Copy link
Author

edib commented Sep 25, 2023

12factor.net

@edib
Copy link
Author

edib commented Sep 25, 2023

@edib
Copy link
Author

edib commented Sep 25, 2023

@edib
Copy link
Author

edib commented Sep 25, 2023

@edib
Copy link
Author

edib commented Sep 25, 2023

@edib
Copy link
Author

edib commented Sep 25, 2023

alias a='alias'
alias k='kubectl '
alias ka='kubectl apply -f '
alias kaf='kubectl apply -f '
alias kcf='kubectl create -f '
alias kd='kubectl delete '
alias kdf='kubectl delete -f '
alias kg='kubectl get '
alias kgd='kubectl get deployments'
alias kgn='kubectl get nodes'
alias kgnl='kubectl get nodes --show-labels'
alias kgnw='kubectl get nodes -o wide'
alias kgp='kubectl get pods'
alias kgpa='kubectl get pods --all-namespaces'
alias kgs='kubectl get svc'
alias kl='kubectl logs'
alias klf='kubectl logs -f'
alias kns='function __kubens() { kubectl config set-context --current --namespace="$1"; }; __kubens'
alias kx='function __kexec() { kubectl exec -it $1 -- bash; }; __kexec'
alias kxa='function __kexec() { kubectl exec -it $1 -- ash; }; __kexec'
alias kxs='function __kexec() { kubectl exec -it $1 -- sh; }; __kexec'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment