exec_in_pod
Execute commands in Kubernetes pods and return output. Uses array of arguments for secure, no-shell execution.
Instructions
Execute a command in a Kubernetes pod or container and return the output. Command must be an array of strings where the first element is the executable and remaining elements are arguments. This executes directly without shell interpretation for security.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | Name of the pod to execute the command in | |
| command | Yes | Command to execute as an array of strings (e.g. ["ls", "-la", "/app"]). First element is the executable, remaining are arguments. Shell operators like pipes, redirects, or command chaining are not supported - use explicit array format for security. | |
| context | No | Kubeconfig Context to use for the command (optional - defaults to null) | |
| timeout | No | Timeout for command - 60000 milliseconds if not specified | |
| container | No | Container name (required when pod has multiple containers) | |
| namespace | No | Kubernetes namespace | default |