kubectlDebugging

kubectl exec

Runs a command inside a running container in a pod.

Syntax

kubectl exec [-it] <pod> -- <command>

Examples

Open a shell inside a pod

kubectl exec -it api-7d9f8-x2k1p -- sh

Related commands