Actions54
- Namespace Actions
- Deployment Actions
- Service Actions
- Pod Actions
- StatefulSet Actions
- ConfigMap Actions
- Secret Actions
- Job Actions
- CronJob Actions
- Node Actions
- Workload Actions
Overview
This node integrates with Rancher and Kubernetes APIs to manage Kubernetes cluster resources. Specifically, the Drain operation on the Node resource prepares a Kubernetes node for maintenance by safely evicting pods from it. This is useful when you want to perform updates or maintenance on a node without disrupting running workloads.
Typical use cases include:
- Draining a node before upgrading its software or hardware.
- Preparing a node for decommissioning.
- Ensuring workloads are gracefully terminated or moved to other nodes.
For example, you might drain a node to allow pods to terminate within a specified grace period, ignoring DaemonSet pods, and optionally forcing eviction of pods not managed by controllers.
Properties
Name | Meaning |
---|---|
Node ID | The unique identifier of the node to be drained. |
Drain Options | Collection of options controlling the drain behavior: |
- Grace Period: Time in seconds given to each pod to terminate gracefully (default 30). | |
- Ignore Daemon Sets: Whether to ignore DaemonSet-managed pods during drain (default true). | |
- Delete Local Data: Continue even if pods use emptyDir local storage (default false). | |
- Force: Continue even if pods are not managed by a controller (default false). | |
Cluster Name or ID | Selects the Kubernetes cluster where the node resides. |
Project Name or ID | (Optional) Selects the project within the cluster. |
Namespace Name or ID | (Optional) Selects the namespace within the project. |
Output
The node outputs JSON data representing the result of the drain operation on the specified node. This typically includes status information about the node and the outcome of the drain process, such as success confirmation or details about any pods affected.
No binary data output is produced by this operation.
Dependencies
- Requires connection to a Rancher or Kubernetes API endpoint.
- Needs an API authentication token or API key credential configured in n8n to authorize requests.
- The node depends on the availability of the target cluster, project, and namespace identifiers.
- The "Cluster Name or ID" property must correspond to a valid cluster accessible via the configured credentials.
Troubleshooting
Common Issues:
- Invalid or missing Node ID will cause the operation to fail.
- Insufficient permissions or invalid API credentials can lead to authorization errors.
- Specifying a non-existent cluster, project, or namespace will result in resource not found errors.
- Draining a node with pods that cannot be evicted due to policy restrictions may cause the operation to hang or fail unless
force
is enabled.
Error Messages:
- "Node not found": Verify the Node ID and cluster selection.
- "Unauthorized" or "Forbidden": Check API credentials and permissions.
- "Pods could not be evicted": Consider enabling
force
or adjusting pod management policies. - Timeouts: Increase the grace period or check network connectivity to the cluster.
Links and References
- Kubernetes Node Drain Documentation
- Rancher API Documentation
- n8n Expressions Documentation (for dynamic property values)