exec_in_pod
Execute commands inside a Kubernetes pod or container by specifying the executable and arguments as an array, with support for namespace, container selection, and timeout.
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 | |
| namespace | No | Kubernetes namespace | default |
| 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. | |
| container | No | Container name (required when pod has multiple containers) | |
| timeout | No | Timeout for command - 60000 milliseconds if not specified | |
| context | No | Kubeconfig Context to use for the command (optional - defaults to null) |