Rancher icon

Rancher

Interact with Rancher/Kubernetes API

Overview

This node allows users to interact with Rancher and Kubernetes APIs to manage various Kubernetes resources, including Secrets. Specifically, for the Secret resource with the Update operation, it enables updating existing Kubernetes secrets within a specified cluster, project, and namespace.

Typical use cases include:

  • Updating sensitive configuration data stored as Kubernetes secrets.
  • Modifying credentials or tokens used by applications running in Kubernetes.
  • Automating secret rotation or updates as part of CI/CD pipelines.

For example, you might update a database password stored in a secret after a credential change, ensuring your applications use the latest credentials without manual intervention.

Properties

Name Meaning
Cluster Name or ID Select the Kubernetes cluster where the secret resides. You can choose from a list or specify an ID via expression.
Project Name or ID (Optional) Select the project within the cluster. Choose from a list or specify an ID via expression.
Namespace Name or ID (Optional) Select the namespace within the project. Choose from a list or specify an ID via expression.

These properties define the scope (cluster, project, namespace) where the secret to be updated is located.

Output

The node outputs JSON data representing the result of the update operation on the secret resource. This typically includes the updated secret's metadata and data fields as returned by the Rancher/Kubernetes API.

No binary data output is indicated for 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

  • Common issues:

    • Incorrect cluster, project, or namespace selection may cause the update to fail due to resource not found.
    • Insufficient permissions or invalid API credentials will result in authorization errors.
    • Providing incomplete or malformed secret data during update can cause API validation errors.
  • Error messages:

    • "Resource not found" — Verify that the cluster, project, namespace, and secret exist.
    • "Unauthorized" or "Forbidden" — Check API credentials and user permissions.
    • "Validation failed" — Ensure all required fields for the secret update are correctly provided.

Resolving these usually involves verifying input parameters, checking API access rights, and confirming the secret exists before attempting an update.

Links and References

Discussion