Skip to content

Instantly share code, notes, and snippets.

@AnthonyAmanse
Last active June 6, 2024 17:51
Show Gist options
  • Select an option

  • Save AnthonyAmanse/1366e9ade92eb2b0dbf9d2442279dd3e to your computer and use it in GitHub Desktop.

Select an option

Save AnthonyAmanse/1366e9ade92eb2b0dbf9d2442279dd3e to your computer and use it in GitHub Desktop.

Revisions

  1. AnthonyAmanse revised this gist Aug 22, 2018. 1 changed file with 4 additions and 0 deletions.
    4 changes: 4 additions & 0 deletions alias-kubernetes
    Original file line number Diff line number Diff line change
    @@ -1,3 +1,7 @@
    # 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'
  2. AnthonyAmanse created this gist Aug 22, 2018.
    24 changes: 24 additions & 0 deletions alias-kubernetes
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,24 @@
    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) }