Copy-ready commandkubectl exec — Basic Usage
kubectl exec -it -n production pod/web-abc123 -- /bin/shRequirements and permissions
- Requirements
- Docker Engine, Docker Compose, or kubectl
- Permissions
- Container or cluster permissions vary
- Last reviewed
- 2026-07-31
Examples
Basic Usage
Use kubectl exec for a standard administrative task.
kubectl exec -it -n production pod/web-abc123 -- /bin/shOriginal command
Run a command inside a Kubernetes pod.
kubectl exec -it -n production pod/web-abc123 -- /bin/shCommon errors
Command not found
Confirm Docker Engine, Docker Compose, or kubectl is installed and available in your current shell.