Rancher27 icon

Rancher27

Interact with Rancher/Kubernetes API

Actions40

Overview

This node enables interaction with Rancher and Kubernetes APIs to manage various Kubernetes resources programmatically. Specifically, for the Deployment - Create operation, it allows users to create a new deployment within a specified Kubernetes cluster, project, and namespace. This is useful for automating application deployments, scaling containerized workloads, or integrating Kubernetes resource management into workflows.

Typical use cases include:

  • Automating deployment of containerized applications using specific Docker images.
  • Setting environment variables dynamically for containers.
  • Managing replica counts to control application scalability.
  • Adding metadata such as labels and annotations for organization and selection purposes.

Example: Automatically deploy a web application by specifying its Docker image, number of replicas, and container port, along with environment variables for configuration.

Properties

Name Meaning
Name The name of the deployment resource to create.
Image Docker image to use for the container(s) in the deployment.
Replicas Number of pod replicas to run (scale of the deployment).
Container Port Port number exposed on the container.
Environment Variables List of environment variables to set inside the container(s), each with a name and value.
Cluster Name or ID Selects the Kubernetes cluster where the deployment will be created.
Project Name or ID Selects the project within the cluster for the deployment.
Namespace Name or ID Selects the namespace within the project where the deployment will reside.
Labels Key-value pairs used to label the deployment for identification and selection.
Annotations Key-value pairs used to annotate the deployment with additional metadata.

Output

The node outputs JSON data representing the response from the Rancher/Kubernetes API after creating the deployment. This typically includes details about the newly created deployment resource such as its metadata, status, and specification.

The output structure is an array of objects, each containing a json field with the deployment information returned by the API.

No binary data output is produced by this operation.

Dependencies

  • Requires access to a Rancher or Kubernetes API endpoint.
  • Requires an API authentication token or key configured in n8n credentials to authorize requests.
  • The node depends on dynamic loading of clusters, projects, and namespaces via internal methods to populate dropdown options.
  • Proper RBAC permissions are needed in the target Kubernetes cluster to create deployments.

Troubleshooting

  • Common issues:

    • Invalid or missing cluster/project/namespace selections can cause failures.
    • Insufficient permissions may result in authorization errors.
    • Incorrect Docker image names or tags can cause deployment creation to fail.
    • Network connectivity issues to the Rancher/Kubernetes API endpoint.
  • Error messages:

    • Authorization errors: Check API credentials and user permissions.
    • Resource not found: Verify cluster, project, and namespace IDs.
    • Validation errors: Ensure required fields like name, image, and replicas are correctly provided.
    • Timeout or connection errors: Confirm network access to the API server.

Resolving these usually involves verifying input parameters, ensuring correct credential setup, and confirming cluster accessibility.

Links and References

Discussion