DevOps · Command
kubectl exec
Runs a command inside a container in a Kubernetes Pod. Use -- before the command, and use -c to select 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 attachkubectl logsGet a Shell to a Running Container