# Kubernetes ## `kubectl` ### `kubectl get` ```sh kubectl config get-contexts # list available contexts kubectl get namespaces # list namespaces inside current context kubectl get pod -n|--namespace # list pods inside namespace kubectl get pod [-n|--namespace ] -o|--output jsonpath='{.spec.containers[*].name}' # list containers inside pod ``` ### `kubectl exec` ```sh kubectl exec [-i|--stdin] [-t|--tty] [-n|--namespace ] [-c|--container ] -- # execute a command inside a container ``` ### `kubectl logs` ```sh kubectl logs [-f|--follow] [-n|--namespace ] [-c|--container] # get pod/container logs ```