Actions90
- Jobs Actions
- Namespaces Actions
- Pods Actions
- Services Actions
- Deployments Actions
- ReplicaSets Actions
- StatefulSets Actions
- DaemonSets Actions
- CronJobs Actions
Overview
This node enables interaction with Kubernetes clusters, specifically focusing on managing Kubernetes namespaces and other resources. The Exec operation allows executing commands inside a container within a pod in a specified namespace. This is useful for running diagnostic commands, debugging applications, or performing administrative tasks directly inside containers without needing separate SSH access.
Practical examples include:
- Running shell commands inside a pod to inspect logs or configuration.
- Executing scripts or utilities inside containers for maintenance or troubleshooting.
- Automating container-level operations as part of CI/CD pipelines or monitoring workflows.
Properties
| Name | Meaning |
|---|---|
| Image | The container image name used when running or restarting pods, or patching resources. |
| Namespace | The Kubernetes namespace where the resource (e.g., pod) resides. Defaults to "default". |
| Resource Name | The specific name of the Kubernetes resource (e.g., pod name) to target for the command. |
Note: For the Exec operation, the node expects the resource to be a pod (or similar containerized resource), and the command to execute must be provided as an array (not shown here but implied from code).
Output
The node outputs JSON data representing the result of the executed command inside the container. Specifically, it returns the standard output (stdout) of the command run inside the pod. The output is structured as an array of JSON objects, each containing the execution results corresponding to the input items processed.
No binary data output is indicated for this operation.
Dependencies
- Requires valid Kubernetes API credentials configured in n8n to authenticate and interact with the cluster.
- Depends on a Kubernetes client utility internally to communicate with the Kubernetes API.
- The node requires the user to provide the correct namespace, resource name, and container image details as applicable.
Troubleshooting
- Missing Credentials Error: If no Kubernetes credentials are returned, the node throws an error. Ensure that valid Kubernetes API credentials are configured and selected.
- Command Format Error: The command property must be a JSON array. Providing a non-array value will cause an error. Verify that the command is correctly formatted as an array of strings.
- Resource Not Found: If the specified namespace or resource name does not exist, the Kubernetes API will return an error. Double-check the names and ensure the resource exists.
- Permission Issues: Insufficient permissions in the Kubernetes cluster may prevent command execution. Confirm that the credentials have appropriate RBAC roles.