Skip to content

Instantly share code, notes, and snippets.

@zeqk
Last active May 23, 2023 18:18
Show Gist options
  • Save zeqk/edde85aa005c26d4e6754e483bf6505a to your computer and use it in GitHub Desktop.
Save zeqk/edde85aa005c26d4e6754e483bf6505a to your computer and use it in GitHub Desktop.

My K8s Cheatsheet

Contexts

Show current context

kubectl config current-context

Set current context

kubectl config use-context aks-itools-iprd-ue

Delete contexts

kubectl config unset current-context

kubectl config delete-cluster aks-itools-iprd-ue

kubectl config delete-context aks-itools-iprd-ue

kubectl config delete-user clusterUser_rg-itools-iprd-ue_aks-itools-iprd-ue

Delete all contexts

kubectl config unset current-context
kubectl config unset contexts
kubectl config unset clusters
kubectl config unset users

Namespaces

kubectl config view --minify | grep namespace:
kubectl config set-context --current --namespace=helloworld

Helm

helm list --all-namespaces

CRDs

kubectl get crd -A

Roles

kubectl get rolebindings -A -o wide
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment