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 CronJob - Create operation, it allows users to create a new CronJob resource in a specified Kubernetes namespace. This is useful for automating scheduled tasks or batch jobs that need to run periodically in a Kubernetes cluster.

Typical use cases include:

  • Scheduling periodic data processing jobs.
  • Automating backups or maintenance tasks.
  • Running recurring reports or notifications.

By using this node, users can automate the deployment of CronJobs without manually interacting with the Kubernetes API or Rancher UI.

Properties

Name Meaning
Cluster Name or ID Select the Kubernetes cluster where the CronJob will be created. Choose from the list or specify an ID via expression.
Project Name or ID Select the project within the cluster. Depends on the selected cluster. Choose from the list or specify an ID via expression.
Namespace Name or ID Select the namespace within the project where the CronJob will be created. Choose from the list or specify an ID via expression.

Note: The provided properties JSON only includes cluster, project, and namespace selection fields. The bundled code suggests additional parameters might be required for creating resources like name, image, replicas, command, environment variables, etc., but these are not explicitly listed for CronJob creation in the provided snippet.

Output

The node outputs an array of JSON objects representing the response from the Rancher/Kubernetes API after creating the CronJob. Each output item contains a json field with the details of the created CronJob resource, including metadata and status as returned by the API.

No binary data output is indicated for this operation.

Dependencies

  • Requires access to a Rancher or Kubernetes API endpoint.
  • Needs an API authentication token or key configured in n8n credentials (referred generically as "an API key credential").
  • The node depends on dynamic loading methods to fetch available clusters, projects, and namespaces (getClusters, getProjects, getNamespaces), which must be properly configured and accessible.

Troubleshooting

  • Common issues:

    • Incorrect or missing cluster/project/namespace selections may cause failures.
    • Insufficient permissions or invalid API credentials can lead to authorization errors.
    • Network connectivity problems to the Rancher/Kubernetes API endpoint.
    • Missing required parameters for CronJob creation if not properly set.
  • Error messages:

    • Authorization errors typically indicate invalid or missing API credentials.
    • Resource not found errors suggest incorrect cluster/project/namespace IDs.
    • Validation errors from the API may occur if required fields for the CronJob are missing or malformed.

To resolve these:

  • Verify API credentials and permissions.
  • Confirm cluster, project, and namespace IDs are correct and accessible.
  • Ensure all required input parameters for the CronJob creation are provided.
  • Check network connectivity to the Rancher/Kubernetes API.

Links and References

Discussion