mirror of
https://github.com/m-lamonaca/dev-notes.git
synced 2025-04-06 10:56:41 +00:00
702 B
702 B
Kubernetes
kubectl
kubectl get
kubectl config get-contexts # list available contexts
kubectl get namespaces # list namespaces inside current context
kubectl get pod -n|--namespace <namespace> # list pods inside namespace
kubectl get pod [-n|--namespace <namespace>] <pod> -o|--output jsonpath='{.spec.containers[*].name}' # list containers inside pod
kubectl exec
kubectl exec [-i|--stdin] [-t|--tty] [-n|--namespace <namespace>] <pod> [-c|--container <container>] -- <command> # execute a command inside a container
kubectl logs
kubectl logs [-f|--follow] [-n|--namespace <namespace>] <pod> [-c|--container] # get pod/container logs