Rancher icon

Rancher

Interact with Rancher/Kubernetes API

Overview

This node enables interaction with Rancher and Kubernetes APIs to manage various Kubernetes resources, including CronJobs. Specifically, for the CronJob resource, it supports operations such as creating, deleting, retrieving, resuming, and suspending CronJobs.

The Suspend operation for a CronJob allows users to pause the execution of scheduled jobs temporarily without deleting the CronJob itself. This is useful in scenarios where you want to halt job executions during maintenance windows or troubleshooting periods without losing the job configuration.

Practical example:

  • You have a CronJob that runs nightly backups. During system upgrades or maintenance, you want to suspend these backups temporarily to avoid conflicts or performance issues. Using this node's Suspend operation on the CronJob resource, you can easily pause the job schedule and resume it later.

Properties

Name Meaning
Cluster Name or ID Select the Kubernetes cluster by name or ID where the CronJob resides.
Project Name or ID (Optional) Select the project within the cluster.
Namespace Name or ID (Optional) Select the namespace within the project where the CronJob is located.

These properties are used to scope the API request to the correct cluster, project, and namespace context.

Output

The node outputs JSON data representing the result of the performed operation on the CronJob resource. For the Suspend operation, the output typically includes the updated state of the CronJob, reflecting that it is now suspended.

The exact structure depends on the Rancher/Kubernetes API response but generally contains fields describing the CronJob metadata, spec, and status.

No binary data output is produced by this node.

Dependencies

  • Requires an API authentication credential configured in n8n to connect to the Rancher/Kubernetes API.
  • The node relies on Rancher's API endpoints to perform operations on Kubernetes resources.
  • Proper permissions must be granted to the API token to allow suspending CronJobs in the specified cluster/project/namespace.

Troubleshooting

  • Common issues:

    • Incorrect cluster, project, or namespace selection may lead to "resource not found" errors.
    • Insufficient API permissions can cause authorization failures.
    • Network connectivity issues to the Rancher server will prevent API calls.
  • Error messages and resolutions:

    • "Resource not found" — Verify that the cluster, project, namespace, and CronJob exist and are correctly specified.
    • "Unauthorized" or "Forbidden" — Check that the API credentials have sufficient permissions to modify CronJobs.
    • Timeouts or connection errors — Ensure network access to the Rancher API endpoint and that the endpoint URL is correct.

Links and References

Discussion