Actions90
- Namespaces Actions
- Pods Actions
- Services Actions
- Deployments Actions
- ReplicaSets Actions
- StatefulSets Actions
- DaemonSets Actions
- Jobs Actions
- CronJobs Actions
Overview
This node enables interaction with Kubernetes clusters by performing various operations on Kubernetes resources. Specifically for the Deployments resource and the Restart operation, it allows restarting a deployment within a specified namespace.
Common scenarios where this node is beneficial include:
- Automating deployment restarts after configuration changes or updates.
- Integrating Kubernetes deployment management into broader automation workflows.
- Quickly restarting deployments without manual
kubectl
commands.
For example, you can use this node to restart a deployment named "my-app" in the "production" namespace to apply new environment variables or recover from transient errors.
Properties
Name | Meaning |
---|---|
Image | The container image name (string). Used when running or restarting pods. |
Namespace | The Kubernetes namespace where the deployment resides. Defaults to "default" . |
Resource Name | The name of the specific deployment resource to target for the operation. |
Note: For the Restart operation on Deployments, the relevant properties are Namespace and Resource Name. The Image property is also available but typically more relevant for run-related operations.
Output
The node outputs JSON data representing the result of the Kubernetes operation performed. For the Restart operation on Deployments, the output will generally contain information about the restarted deployment or pod status as returned by the Kubernetes API client.
The output JSON structure is an array of objects, each corresponding to an item processed by the node. Each object contains details such as status messages or metadata related to the restart action.
No binary data output is produced by this node.
Dependencies
- Requires access to a Kubernetes cluster with appropriate permissions to manage deployments.
- Needs an API authentication token or credentials configured in n8n to connect securely to the Kubernetes API.
- Uses an internal Kubernetes client utility (
K8SClient
) to interact with the cluster.
Troubleshooting
No credentials got returned!
This error indicates that the node could not retrieve the necessary Kubernetes API credentials. Ensure that the API key or authentication token is correctly configured in n8n credentials.Command must be an array!
Although not directly related to Restart, if using operations like Run, ensure that the command input is a valid JSON array.If the restart does not take effect, verify that the deployment name and namespace are correct and that the Kubernetes user has sufficient permissions.
Network connectivity issues between n8n and the Kubernetes API server can cause failures; check firewall rules and endpoint accessibility.