Skip to content

Instantly share code, notes, and snippets.

@unstppbl
Created March 24, 2020 12:55
Show Gist options
  • Save unstppbl/6268e59669ece42c5fce5fc4814b2ef7 to your computer and use it in GitHub Desktop.
Save unstppbl/6268e59669ece42c5fce5fc4814b2ef7 to your computer and use it in GitHub Desktop.
Kubectl cmds
# list all pods
kubectl -n dev get pods
# list all config maps (CM) for env vars etc.
kubectl -n dev get cm
# get logs of pod
kubectl -n dev logs -f <pod name>
# get content of CM
kubectl -n dev get cm <cm name> -o yaml
# enter inside of pod
kubectl -n dev exec -it <pod name> <command>
# list all PersistentVolumes (where VOLUME is hosted)
kubectl -n dev get pv
kubectl -n dev get pv -o yaml
# list all secrets (passwords etc.,). Secrets are stored as base64 encoded
kubectl -n dev get secrets
kubectl -n dev get secrets <secret> -o yaml
# list all Deployments, and Docker version of pods
kubectl -n dev get deployments -o wide
kubectl -n dev get deployments <deployment> -o yaml
# list all Services (ports etc)
kubectl -n dev get svc
kubectl -n dev get svc <svc> -o yaml
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment