Andrew Mercer
on this page
  • https://kubernetes.io/docs/reference/kubectl/
  • https://kubernetes.io/docs/reference/kubectl/quick-reference/

Guides

Guide Covers
Monitoring and inspecting resources get, describe, logs, top, events, explain, rollout, exec, port-forward, and a triage order for misbehaving pods
Debugging containers with kubectl debug Ephemeral containers, debugging distroless images, pod copies, node debugging
Merge multiple kubectl config files Combining kubeconfigs, name collisions, switching contexts

Shell setup

# bash completion, plus completion for a short alias
echo 'source <(kubectl completion bash)' >> ~/.bashrc
echo 'alias k=kubectl' >> ~/.bashrc
echo 'complete -o default -F __start_kubectl k' >> ~/.bashrc

Set a default namespace for the current context so you don't have to type -n every time:

kubectl config set-context --current --namespace=<namespace>
in this section
* monitoring and inspecting resources with kubectl
* debugging containers with kubectl debug
* merge multiple kubectl config files