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 by performing various operations on Kubernetes resources. Specifically for the ReplicaSets resource and the Restart operation, the node facilitates restarting a ReplicaSet within a specified namespace.
Common scenarios where this node is beneficial include:
- Automating the restart of ReplicaSets to apply configuration changes or recover from issues.
- Integrating Kubernetes management into automated workflows without manual kubectl commands.
- Managing Kubernetes resources programmatically in CI/CD pipelines or monitoring systems.
For example, you can use this node to restart a ReplicaSet named my-replicaset in the default namespace after updating its container image, ensuring the new pods are created with the updated configuration.
Properties
| Name | Meaning |
|---|---|
| Image | The container image to use when running or restarting pods (used in some operations). |
| Namespace | The Kubernetes namespace where the ReplicaSet resides. Defaults to "default". |
| Resource Name | The name of the ReplicaSet resource to target for the operation (e.g., the ReplicaSet's name). |
Note: For the Restart operation, the relevant properties are Namespace and Resource Name. The Image property is also available but typically used in other operations like run or exec.
Output
The node outputs JSON data representing the result of the Kubernetes operation performed. For the Restart operation on ReplicaSets, the output will generally contain information about the restarted ReplicaSet or the status of the restart action.
The output JSON structure includes fields returned by the Kubernetes API client, such as metadata and status details of the ReplicaSet after the restart command.
If the node supports binary data output (not evident for Restart), it would represent raw data streams or logs, but this is not applicable here.
Dependencies
- Requires a valid Kubernetes API authentication credential configured in n8n to connect to the cluster.
- The node depends on an internal Kubernetes client utility (
K8SClient) to interact with the Kubernetes API. - No external services beyond the Kubernetes cluster itself are required.
Troubleshooting
No credentials got returned!
This error indicates that the node could not retrieve the necessary Kubernetes API credentials. Ensure that the Kubernetes API authentication token or key is correctly configured in n8n credentials.Command must be an array!
Although more relevant to the "run" operation, if you see this error, verify that any command input is provided as a JSON array.If the restart operation fails silently or returns unexpected results, verify that the specified ReplicaSet name and namespace exist and that the user has sufficient permissions to perform restarts.
Network connectivity issues between n8n and the Kubernetes API server can cause failures; ensure proper network access and firewall rules.
Links and References
Kubernetes ReplicaSets documentation:
https://kubernetes.io/docs/concepts/workloads/controllers/replicaset/Kubernetes field selectors:
https://kubernetes.io/docs/concepts/overview/working-with-objects/field-selectors/Kubernetes label selectors:
https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/