Skip to content

Instantly share code, notes, and snippets.

@AnthonyAmanse
Last active May 19, 2024 06:15
Show Gist options
  • Save AnthonyAmanse/1366e9ade92eb2b0dbf9d2442279dd3e to your computer and use it in GitHub Desktop.
Save AnthonyAmanse/1366e9ade92eb2b0dbf9d2442279dd3e to your computer and use it in GitHub Desktop.
# I put them in my shell profile
# I use zsh so it's in ~/.zshrc
# for bash, it might be in ~/.bash_profile
alias k='kubectl'
alias ka='kubectl apply -f'
alias kex='kubectl exec -ti'
alias kl='kubectl logs'
alias kg='kubectl get'
alias kgp='kubectl get pods'
alias kgs='kubectl get services'
alias kgd='kubectl get deploy'
alias kgsec='kubectl get secrets'
alias kgcm='kubectl get cm'
alias kd='kubectl describe'
alias kdp='kubectl describe pods'
alias kds='kubectl describe services'
alias kdd='kubectl describe deploy'
alias kdsec='kubectl describe secrets'
alias kdcm='kubectl describe cm'
# You'll need to be logged in the bx/ibmcloud cli
# this gets the list of clusters
alias kclusters='ibmcloud cs clusters'
# this downloads the kubectl config and applies them in current session
# usage would be "kcluster <CLUSTER_NAME>"
kcluster () { $(ibmcloud cs cluster-config $@ | grep export) }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment