Overview
This node allows executing tasks within a Kubernetes cluster by running containers in specified pods and namespaces. It is useful for workflows that require running containerized jobs or commands inside Kubernetes environments, such as deploying applications, running batch jobs, or performing maintenance tasks on cluster resources.
Typical use cases include:
- Running custom scripts or tools inside a Kubernetes pod.
- Executing jobs in a specific namespace or pod.
- Leveraging existing Kubernetes infrastructure to run containerized workloads dynamically.
For example, you might use this node to run a data processing script inside a Kubernetes pod using a specified Docker image, optionally targeting a particular pod or allowing the system to select any available pod.
Properties
| Name | Meaning |
|---|---|
| Image | Docker image to use for execution inside the Kubernetes pod (e.g., registry.yoshino-s.xyz/yoshino-s/soar-image:dev). |
| Namespace | Kubernetes namespace where the pod resides. You can select from a list of available namespaces. |
| Stateless | Boolean flag indicating whether to use any available pod (stateless) or a specific pod for all executions. |
| Pod | Specific pod to use when Stateless is false. Selectable from a list of pods in the chosen namespace. |
| Debug Mode | Boolean flag to enable detailed input/output information for debugging purposes. |
Output
The node outputs an object under the json field containing the response from the Kubernetes executor proxy. This typically includes execution results or status information related to the container run inside the Kubernetes pod.
If debug mode is enabled, additional detailed information about the execution may be included in the output.
The node does not explicitly handle binary data output.
Dependencies
- Requires access to a Kubernetes cluster with appropriate API credentials.
- Needs an API authentication token or key configured in n8n to connect securely to the Kubernetes API.
- The node depends on internal Kubernetes executor classes and proxy mechanisms bundled within the node's codebase.
Troubleshooting
Common issues:
- Incorrect or missing Kubernetes API credentials will prevent connection to the cluster.
- Specifying a pod that does not exist or is not in the selected namespace will cause errors.
- Using stateless mode without available pods may result in no pod being selected.
Error messages:
- Authentication failures usually indicate invalid or missing API tokens; verify credentials.
- Namespace or pod not found errors suggest incorrect selection; ensure the namespace and pod exist.
- Timeout or connectivity errors may indicate network issues or cluster unavailability.
To resolve these, confirm your Kubernetes credentials, verify the existence of namespaces and pods, and check network connectivity to the cluster.