Rancher27 icon

Rancher27

Interact with Rancher/Kubernetes API

Actions40

Overview

This node integrates with Rancher and Kubernetes APIs to manage various Kubernetes resources. Specifically, for the Deployment resource with the Scale operation, it allows users to adjust the number of replicas (pods) running in a deployment within a specified Kubernetes cluster environment.

Common scenarios where this node is beneficial include:

  • Dynamically scaling applications up or down based on load or scheduled events.
  • Automating deployment management as part of CI/CD pipelines.
  • Managing resource allocation efficiently in multi-tenant Kubernetes clusters.

For example, you can use this node to increase the number of replicas of a web application deployment during peak traffic hours and scale down during off-peak times to save resources.

Properties

Name Meaning
Replicas Number of replicas (pods) to run for the deployment after scaling.
Cluster Name or ID Select the Kubernetes cluster where the deployment exists. 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 where the deployment resides. Depends on the selected project.

Output

The node outputs JSON data representing the result of the scale operation. This typically includes details about the updated deployment state, such as the new replica count and metadata confirming the scaling action.

No binary data output is involved in this operation.

Example output structure (simplified):

{
  "replicas": 3,
  "deploymentName": "my-deployment",
  "namespace": "default",
  "status": "scaled"
}

Dependencies

  • Requires an API authentication token or API key credential configured in n8n to connect securely to the Rancher/Kubernetes API.
  • The node depends on the Rancher/Kubernetes cluster being accessible and properly configured with the necessary permissions to perform scaling operations.
  • The user must have access to the specified cluster, project, and namespace.

Troubleshooting

  • Common issues:

    • Incorrect cluster, project, or namespace selection leading to "resource not found" errors.
    • Insufficient permissions to scale deployments causing authorization errors.
    • Network connectivity problems between n8n and the Kubernetes cluster API endpoint.
  • Error messages and resolutions:

    • "Deployment not found": Verify that the deployment name and namespace are correct and exist in the selected cluster/project.
    • "Unauthorized" or "Forbidden": Check that the API credentials have sufficient RBAC permissions to scale deployments.
    • Timeout or connection errors: Ensure network access to the Kubernetes API server and that the cluster is reachable.

Links and References

Discussion