Rancher27 icon

Rancher27

Interact with Rancher/Kubernetes API

Actions40

Overview

The node provides integration with Rancher/Kubernetes API to manage Kubernetes resources. Specifically, the Drain operation on the Node resource allows users to safely evict all pods from a specified Kubernetes node in preparation for maintenance or decommissioning. This operation ensures that workloads are gracefully terminated or rescheduled elsewhere, minimizing disruption.

Common scenarios where this node is beneficial include:

  • Performing maintenance on a Kubernetes node without impacting running applications.
  • Decommissioning or upgrading nodes by first draining them.
  • Automating cluster management workflows that require controlled pod eviction.

For example, an administrator can use this node to drain a node before rebooting it, specifying options such as grace period for pod termination and whether to ignore daemon sets.

Properties

Name Meaning
Node ID The unique identifier of the Kubernetes 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 pods managed by DaemonSets (default true).
- Delete Local Data: Continue even if pods use emptyDir volumes (default false).
- Force: Continue even if pods are not managed by a controller (default false).
Cluster Name or ID Select the Kubernetes cluster where the node resides. Can be chosen from a list or specified via expression.
Project Name or ID Select the project within the cluster. Depends on the selected cluster.
Namespace Name or ID Select the namespace within the project. Depends on the selected 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 request, such as success confirmation or details about pods affected.

No binary data output is produced by this operation.

Dependencies

  • Requires access to a Rancher or Kubernetes API endpoint configured with appropriate credentials (an API key or token).
  • The node depends on n8n credentials configured for Rancher/Kubernetes API authentication.
  • The user must have sufficient permissions to perform node drain operations on the target cluster.

Troubleshooting

  • Common issues:
    • Insufficient permissions to drain nodes may cause authorization errors.
    • Specifying an incorrect node ID will result in "node not found" errors.
    • Draining nodes with pods that cannot be evicted due to missing controllers or local data usage may fail unless force or deleteLocalData options are enabled.
  • Error messages:
    • Unauthorized / Forbidden: Check API credentials and RBAC permissions.
    • Node not found: Verify the node ID and cluster/project/namespace selections.
    • Pods not managed by a controller: Enable the Force option to override.
    • Pods using emptyDir volumes: Enable Delete Local Data to proceed despite local storage usage.

Links and References

Discussion