Rancher27 icon

Rancher27

Interact with Rancher/Kubernetes API

Actions40

Overview

This node integrates with Rancher and Kubernetes APIs to manage various Kubernetes resources programmatically within n8n workflows. Specifically, for the Namespace - Create operation, it allows users to create a new namespace within a specified cluster and project context.

Common scenarios where this node is beneficial include:

  • Automating Kubernetes environment setup by creating namespaces dynamically.
  • Organizing workloads by programmatically segmenting resources into namespaces.
  • Integrating Kubernetes namespace creation as part of CI/CD pipelines or infrastructure automation workflows.

For example, you might use this node to create a namespace before deploying applications or services into that namespace, ensuring isolation and resource management.

Properties

Name Meaning
Cluster Name or ID Select the target Kubernetes cluster by name or ID. This determines where the namespace will be created.
Project Name or ID Select the project within the chosen cluster where the namespace will be created.
Namespace Name or ID Specify the name of the namespace to create. Can be selected from existing namespaces or provided as a custom value/expression.

Output

The node outputs JSON data representing the result of the namespace creation API call. This typically includes details about the newly created namespace such as its name, status, metadata, and other relevant Kubernetes namespace information.

No binary data output is involved in this operation.

Example output structure (simplified):

{
  "metadata": {
    "name": "example-namespace",
    "uid": "unique-identifier",
    "creationTimestamp": "2024-01-01T00:00:00Z"
  },
  "status": {
    "phase": "Active"
  }
}

Dependencies

  • Requires an API authentication token or key credential configured in n8n to connect securely to the Rancher/Kubernetes API.
  • The node depends on Rancher/Kubernetes API endpoints being accessible and properly configured.
  • The user must have appropriate permissions to create namespaces in the targeted cluster/project.

Troubleshooting

  • Common issues:

    • Insufficient permissions: The API token used may lack rights to create namespaces.
    • Invalid cluster or project selection: Ensure the cluster and project IDs are correct and accessible.
    • Namespace name conflicts: Attempting to create a namespace that already exists will cause errors.
  • Error messages:

    • "Forbidden" or "Unauthorized": Check API credentials and permissions.
    • "Namespace already exists": Choose a unique namespace name.
    • "Cluster or project not found": Verify cluster and project selections.

Resolving these usually involves verifying credentials, permissions, and input parameters.

Links and References

Discussion