Commands.app

kubectl exec

Debugging

Execute command in container

Options & Flags
Available options for this command
-it

Interactive TTY

-c

Container name

Examples
Common usage examples

Run command in pod

kubectl exec mypod -- ls /app

Interactive shell in pod

kubectl exec -it mypod -- /bin/bash

Shell in specific container

kubectl exec -it mypod -c mycontainer -- sh
Notes
  • Use -- to separate kubectl args from command
Related Commands
You might also find these useful