Kubernetes icon

Kubernetes

Interact with Kubernetes

Overview

This node enables interaction with Kubernetes resources, specifically supporting operations such as getting, listing, running, deleting, and more on various Kubernetes resource types. For the CronJobs resource with the Get operation, it retrieves details of one or multiple CronJob resources within a specified namespace in a Kubernetes cluster.

Common scenarios include:

  • Fetching the configuration and status of a specific CronJob by name.
  • Listing CronJobs filtered by labels or fields to monitor scheduled jobs.
  • Integrating Kubernetes CronJob data into automation workflows for monitoring or auditing purposes.

Practical example:

  • Retrieve a CronJob named "backup-job" in the "default" namespace to check its schedule and last run status before triggering downstream processes.

Properties

Name Meaning
Namespace The Kubernetes namespace where the CronJob resource resides. Defaults to "default".
Resource Name The exact name of the CronJob resource to retrieve. If provided, the node fetches this specific resource.
Field Selector A Kubernetes field selector string to filter CronJobs based on resource fields (e.g., metadata.name=example).
Label Selector A Kubernetes label selector string to filter CronJobs based on labels (e.g., app=backup).

Output

The node outputs JSON data representing the retrieved CronJob(s). The structure corresponds to the Kubernetes API response for CronJobs, typically including metadata (name, namespace, labels), specification (schedule, job template), and status information.

If a specific resource name is provided, the output will be a single CronJob object; otherwise, it may be a list of CronJobs matching the selectors.

No binary data output is produced by this operation.

Dependencies

  • Requires valid Kubernetes API credentials configured in n8n to authenticate and communicate with the Kubernetes cluster.
  • Relies on the Kubernetes API server being accessible from the n8n environment.
  • No additional external services are required beyond Kubernetes itself.

Troubleshooting

  • No credentials got returned!
    This error indicates missing or misconfigured Kubernetes API credentials. Ensure that the node has access to valid credentials with sufficient permissions to read CronJob resources.

  • Command must be an array!
    Although not relevant for the Get operation, this error can appear if the node is used with other operations requiring command input. Make sure commands are provided as JSON arrays.

  • Resource not found or permission denied
    If the specified CronJob name does not exist or the credentials lack permissions, the node may fail. Verify the resource name, namespace, and RBAC permissions.

  • Field or label selector syntax errors
    Incorrectly formatted selectors can cause no results or errors. Refer to Kubernetes documentation on field and label selectors for correct syntax.

Links and References

Discussion