% kubernetes, k8s # Print all contexts kubectl config get-contexts # Print current context of kubeconfig kubectl config current-context # Set context of kubeconfig kubectl config use-context # Print resource documentation kubectl explain # Get nodes (add option '-o wide' for details) kubectl get nodes # Get namespaces kubectl get namespaces # Get pods from namespace (add option '-o wide' for details) kubectl get pods -n # Get pods from all namespace (add option '-o wide' for details) kubectl get pods --all-namespaces # Get services from namespace kubectl get services -n # Get details from resource on namespace kubectl describe / -n # Print logs from namespace kubectl logs -f pods/ -n # Get deployments kubectl get deployments -n # Edit deployments kubectl edit deployment/ -n # Drain node in preparation for maintenance kubectl drain # Mark node as schedulable kubectl uncordon # Mark node as unschedulable kubectl cordon # Display resource (cpu/memory/storage) usage kubectl top