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 resources, specifically supporting operations on various resource types including Services. For the Services resource with the Restart operation, the node facilitates restarting a service within a specified Kubernetes namespace.
Common scenarios where this node is beneficial include automating Kubernetes management tasks such as restarting services after configuration changes or deployments, integrating Kubernetes control into workflows, and managing cluster resources programmatically without manual kubectl commands.
For example, you can use this node to restart a specific service in your "default" namespace by specifying its name and triggering the restart operation, which helps ensure that the service picks up new configurations or recovers from transient errors.
Properties
| Name | Meaning |
|---|---|
| Image | The container image to use when running or restarting pods (required for restart). |
| Namespace | The Kubernetes namespace where the service resides; defaults to "default". |
| Resource Name | The name of the specific service resource to target for the restart operation. |
Note: Although the provided properties JSON does not explicitly list a "command" property for Restart, the bundled code shows "image" is required for restart operations.
Output
The node outputs JSON data representing the result of the restart operation. This typically includes standard output (stdout) from running the pod associated with the restart command, indicating success or failure messages from Kubernetes.
The output JSON structure is an array of objects, each containing details about the executed operation's result. No binary data output is indicated for the Restart 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 perform API calls.
- The node expects the user to provide a container image for restart-related operations.
Troubleshooting
No credentials got returned!
This error occurs if Kubernetes API credentials are missing or not properly configured. Ensure that the node has access to valid Kubernetes authentication tokens or API keys.Command must be an array!
While this error is shown in the code for the "run" operation, it may also affect restart if commands are involved. Make sure any command input is a valid JSON array.Restart operation failures
If the restart fails, verify that the specified namespace and service name exist and that the provided image is correct and accessible in the cluster.