Rancher icon

Rancher

Interact with Rancher/Kubernetes API

Overview

This node interacts with the Rancher/Kubernetes API to manage Kubernetes resources. Specifically, for the Namespace - Update operation, it updates an existing namespace within a specified cluster and project context. This is useful when you need to modify metadata or configuration of a namespace without deleting and recreating it.

Common scenarios include:

  • Changing labels or annotations on a namespace.
  • Adjusting namespace settings as part of deployment automation.
  • Integrating namespace updates into CI/CD pipelines for Kubernetes environments managed by Rancher.

Example: Automatically update a namespace's labels to reflect environment changes (e.g., from "dev" to "staging") during a deployment workflow.

Properties

Name Meaning
Cluster Name or ID Select the target cluster where the namespace exists. Can be chosen from a list or specified via expression.
Project Name or ID Select the project within the cluster that contains the namespace. Optional; can be chosen or specified similarly.
Namespace Name or ID Select the specific namespace to update. Optional; can be chosen or specified similarly.

These properties define the scope and identity of the namespace resource to update.

Output

The node outputs JSON data representing the updated namespace object returned from the Rancher/Kubernetes API. This typically includes details such as:

  • Namespace metadata (name, labels, annotations).
  • Status information.
  • Other relevant namespace configuration fields.

No binary data output is involved in this operation.

Dependencies

  • Requires connection to a Rancher or Kubernetes API endpoint.
  • Needs an API authentication token or key configured in n8n credentials to authorize requests.
  • The node depends on dynamic loading methods to populate options for clusters, projects, and namespaces.

Troubleshooting

  • Missing or invalid cluster/project/namespace IDs: Ensure the selected cluster, project, and namespace exist and are accessible with the provided credentials.
  • API authentication errors: Verify that the API key or token has sufficient permissions to update namespaces.
  • Network connectivity issues: Confirm that n8n can reach the Rancher/Kubernetes API endpoint.
  • Invalid input parameters: Check that required fields are correctly set and expressions resolve properly.

Error messages typically indicate authorization failures, resource not found, or validation errors from the API. Resolving these involves verifying credentials, resource existence, and input correctness.

Links and References

Discussion