kubectl exec
DebuggingExecute command in container
Options & Flags
Available options for this command
-itInteractive TTY
-cContainer name
Examples
Common usage examples
Run command in pod
kubectl exec mypod -- ls /appInteractive shell in pod
kubectl exec -it mypod -- /bin/bashShell in specific container
kubectl exec -it mypod -c mycontainer -- shNotes
- Use -- to separate kubectl args from command
Related Commands
You might also find these useful