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 programmatically within n8n workflows. Specifically, for the Namespace - Delete operation, it deletes a specified namespace from a Kubernetes cluster managed by Rancher.

Common scenarios where this node is beneficial include:

  • Automating cleanup of namespaces after testing or deployment cycles.
  • Managing Kubernetes environments dynamically based on workflow logic.
  • Integrating Kubernetes resource management into broader automation pipelines.

For example, you can use this node to delete a namespace after a CI/CD pipeline finishes deploying and testing an application, ensuring that temporary resources do not persist unnecessarily.

Properties

Name Meaning
Cluster Name or ID Select the target Kubernetes cluster by name or ID. 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 to delete. Choose from a list or specify an ID via expression.

Output

The output of the node is a JSON object representing the result of the delete operation on the namespace. This typically includes confirmation details or status information returned by the Rancher/Kubernetes API about the deletion request.

No binary data output is produced by this operation.

Example output structure (conceptual):

{
  "status": "Success",
  "message": "Namespace deleted",
  "namespace": "example-namespace"
}

Dependencies

  • Requires connection to a Rancher-managed Kubernetes cluster.
  • Needs an API authentication token credential configured in n8n to authorize requests against the Rancher/Kubernetes API.
  • The node depends on dynamic loading methods to fetch available clusters, projects, and namespaces for selection.

Troubleshooting

  • Common issues:

    • Specifying a non-existent or already deleted namespace will cause errors.
    • Insufficient permissions or invalid API credentials may lead to authorization failures.
    • Network connectivity problems to the Rancher server or Kubernetes API can cause timeouts or connection errors.
  • Error messages and resolutions:

    • "Namespace not found": Verify the namespace exists and is correctly specified.
    • "Unauthorized" or "Forbidden": Check that the API key or token has sufficient permissions to delete namespaces.
    • Timeout or connection errors: Ensure network access to the Rancher API endpoint and correct configuration of credentials.

Links and References

Discussion