Kubernetes · Command
kubectl exec
kubectl exec runs a command inside a container in a Kubernetes Pod. Use -- to separate kubectl options from the command, and use -c to choose a container when needed.
Last updated
Syntax
kubectl exec (POD | TYPE/NAME) [-c CONTAINER] [flags] -- COMMAND [args...]In-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.
SubscribeRelated
kubectl logskubectl getkubectl describekubectl apply