Portainer icon

Portainer

Interact with Portainer via API

Actions190

Kubernetes → Get Kubernetes Jobs

AI-generated

Overview

This node operation retrieves Kubernetes Jobs from a specified environment. It is useful for users who want to programmatically access and manage job resources within their Kubernetes clusters. Typical scenarios include monitoring job statuses, auditing job executions, or integrating job data into automation workflows.

For example, a DevOps engineer might use this node to fetch all jobs running in a particular Kubernetes environment to check their completion status or to trigger alerts based on job outcomes.

Properties

Name Meaning
Id The identifier of the Kubernetes environment from which to retrieve jobs (required).
Additional Fields Optional parameters to customize the request:
- Include Cron Job Children Boolean option to include Jobs that are owned by CronJobs (default: true).

Output

The node outputs JSON data representing the list of Kubernetes Jobs retrieved from the specified environment. Each job object typically contains metadata such as job name, status, creation timestamp, and owner references (including whether it is linked to a CronJob if that option is enabled).

If binary data were involved (e.g., logs or artifacts), it would be summarized here, but this operation focuses on JSON job resource data only.

Dependencies

  • Requires access to a Kubernetes environment identified by the provided environment ID.
  • Needs appropriate API credentials or tokens configured in n8n to authenticate with the Kubernetes cluster.
  • No additional external services beyond Kubernetes API are required.

Troubleshooting

  • Common issues:

    • Invalid or missing environment ID can cause failure to connect or retrieve jobs.
    • Insufficient permissions or incorrect API credentials may result in authorization errors.
    • Network connectivity problems between n8n and the Kubernetes cluster can prevent data retrieval.
  • Error messages:

    • "Unauthorized" or "Forbidden": Check that the API token or credentials have sufficient permissions.
    • "Not Found" or "Environment not found": Verify the environment ID is correct and accessible.
    • Timeout or connection errors: Ensure network access and Kubernetes API endpoint availability.

Resolving these usually involves verifying credentials, environment configuration, and network settings.

Links and References

Discussion