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 StatefulSets among other resource types. The Restart operation for StatefulSets triggers a restart of the pods managed by the StatefulSet, which is useful when you want to apply configuration changes or recover from transient errors without deleting the StatefulSet itself.
Common scenarios where this node is beneficial include:
- Automating rolling restarts of StatefulSets after configuration updates.
- Restarting StatefulSets to refresh application state or recover from failures.
- Integrating Kubernetes management into broader automation workflows in n8n.
For example, you might use this node to restart a StatefulSet named my-database in the production namespace after updating its container image or environment variables.
Properties
| Name | Meaning |
|---|---|
| Image | Docker image name used when running or restarting pods (required for run, restart ops). |
| Namespace | Kubernetes namespace where the StatefulSet resides; defaults to default. |
| Resource Name | Name of the specific StatefulSet resource to operate on. |
Output
The node outputs JSON data representing the result of the Kubernetes operation performed. For the Restart operation on StatefulSets, the output typically includes status information about the restart action, such as confirmation that pods were restarted or any relevant logs/output from the restart process.
If the operation involves running pods or commands, the output may include standard output (stdout) from those pods.
No binary data output is indicated in the source code.
Dependencies
- Requires an API authentication token or credentials to access the Kubernetes cluster.
- The node depends on a Kubernetes client utility (
K8SClient) bundled within the node's utilities. - Proper Kubernetes RBAC permissions are necessary to perform restart operations on StatefulSets.
- The node expects the user to provide valid Kubernetes credentials configured in n8n.
Troubleshooting
No credentials got returned!
This error occurs if the node cannot retrieve the required Kubernetes credentials. Ensure that the credentials are properly set up and linked to the node.Command must be an array!
When using operations that require a command input (likerun), the command must be provided as a JSON array. Providing it as a string or other format will cause this error.Resource not found or permission denied
If the specified StatefulSet name or namespace does not exist or the credentials lack sufficient permissions, the operation will fail. Verify resource names, namespaces, and RBAC settings.Invalid image or pod startup failure
For operations requiring an image (like restart), ensure the image name is correct and accessible by the Kubernetes cluster.