Kubectl
See also https://kubernetes.io/docs/reference/kubectl/cheatsheet/
Description | Command |
---|---|
Get namespaces | kubectl get ns |
Set namespace | kubectl config set-context –current –namespace=foo |
Show config | kubectl config view |
Show current namespaces | kubectl config view (then grep namespace) |
Show current context | kubectl config current-context |
Set current context | kubectl config use-context foo |
Remove context | kubectl config unset contexts.foo |
Get all pods | kubectl get pods |
Exec | kubectl exec -it mypod – bash |
Get deployment info | kubectl get deployments foo -o yaml |