Rancher icon

Rancher

Interact with Rancher/Kubernetes API

Overview

This node enables interaction with Rancher and Kubernetes APIs to manage various Kubernetes resources. Specifically, for the Deployment - Delete operation, it allows users to delete a deployment resource within a specified cluster, project, and namespace. This is useful in scenarios where you want to programmatically remove an existing deployment from your Kubernetes environment, such as cleaning up outdated applications or removing failed deployments.

Practical examples include:

  • Automating cleanup of test deployments after CI/CD pipeline runs.
  • Removing deployments that are no longer needed as part of infrastructure management.
  • Integrating deployment deletion into larger workflows for application lifecycle management.

Properties

Name Meaning
Cluster Name or ID Select the Kubernetes cluster where the deployment exists. 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.
Deployment ID The unique identifier of the deployment to delete. Must be selected from a list filtered by project and namespace.

Output

The node outputs JSON data representing the result of the delete operation. Typically, this will contain confirmation details or status information returned by the Rancher/Kubernetes API about the deleted deployment. There is no binary output for this operation.

Example output structure (conceptual):

{
  "status": "Success",
  "message": "Deployment deleted successfully",
  "deploymentId": "deployment-id-value"
}

Dependencies

  • Requires connection to a Rancher or Kubernetes API endpoint.
  • Needs an API authentication token or API key credential configured in n8n to authorize requests.
  • The node depends on dynamic loading methods to fetch clusters, projects, namespaces, and deployments for selection inputs.

Troubleshooting

  • Common issues:

    • Incorrect or missing cluster/project/namespace/deployment IDs may cause failures.
    • Insufficient permissions or invalid API credentials can lead to authorization errors.
    • Network connectivity problems to the Rancher/Kubernetes API endpoint.
  • Error messages and resolutions:

    • "Deployment not found": Verify the deployment ID and ensure it exists in the specified namespace/project/cluster.
    • "Unauthorized" or "Forbidden": Check API credentials and user permissions.
    • Timeout or connection errors: Confirm network access to the Rancher/Kubernetes API server.

Links and References

Discussion