Rancher icon

Rancher

Interact with Rancher/Kubernetes API

Overview

This node allows interaction with Rancher and Kubernetes APIs to manage various Kubernetes resources. Specifically for the Secret resource with the Get operation, it retrieves one or more secrets from a specified cluster, project, and namespace within a Kubernetes environment managed by Rancher.

Common scenarios where this node is beneficial include:

  • Automating retrieval of secret data for use in workflows.
  • Integrating Kubernetes secret management into CI/CD pipelines.
  • Auditing or monitoring secrets stored in Kubernetes clusters.

For example, you can use this node to fetch database credentials stored as Kubernetes secrets before deploying an application that requires those credentials.

Properties

Name Meaning
Cluster Name or ID Select the Kubernetes cluster from which to retrieve the secret. Can be chosen from a list or specified via expression.
Project Name or ID (Optional) Select the project within the cluster. Can be chosen from a list or specified via expression.
Namespace Name or ID (Optional) Select the namespace within the project. Can be chosen from a list or specified via expression.

These properties define the scope (cluster, project, namespace) from which the secret(s) will be fetched.

Output

The node outputs JSON data representing the retrieved secret(s). The structure typically includes metadata about the secret and its data fields encoded in base64, consistent with Kubernetes secret objects.

If multiple secrets are retrieved, the output will be an array of such JSON objects.

No binary data output is indicated for this operation.

Dependencies

  • Requires connection to a Rancher-managed Kubernetes cluster.
  • Needs an API authentication credential configured in n8n to access the Rancher/Kubernetes API.
  • The node depends on dynamic loading methods to populate options for clusters, projects, and namespaces.

Troubleshooting

  • Common issues:

    • Incorrect or missing cluster/project/namespace selection may result in no data or errors.
    • Insufficient permissions or invalid API credentials can cause authorization failures.
    • Network connectivity issues to the Rancher server or Kubernetes API endpoint.
  • Error messages:

    • Authorization errors indicate problems with the provided API key or token; verify credentials.
    • Resource not found errors suggest the specified cluster/project/namespace or secret does not exist; double-check inputs.
    • Timeout or connection errors imply network issues; ensure Rancher and Kubernetes endpoints are reachable.

Resolving these usually involves verifying input parameters, checking API credentials, and ensuring network accessibility.

Links and References

Discussion