Portainer icon

Portainer

Interact with Portainer via API

Actions190

Kubernetes → Delete Jobs

AI-generated

Overview

This node operation allows you to delete Kubernetes Jobs in specified namespaces. It is useful for automating the cleanup or management of batch jobs running in a Kubernetes cluster. For example, you might use this node to remove completed or failed jobs programmatically as part of a CI/CD pipeline or cluster maintenance workflow.

Properties

Name Meaning
Id Environment identifier (a numeric ID) used to specify which environment context to target.
Payload A map where each key is a Kubernetes namespace and the corresponding value is an array of Job names to delete within that namespace.

Output

The node outputs JSON data representing the result of the delete operation. This typically includes status information about the deletion requests for the specified Jobs. The exact structure depends on the API response but generally confirms success or failure per Job.

No binary data output is produced by this node.

Dependencies

  • Requires access to a Kubernetes cluster with appropriate permissions to delete Jobs.
  • Needs an API authentication token or credentials configured in n8n to authorize requests against the Kubernetes API.
  • The node uses HTTP requests to interact with the Kubernetes API server.

Troubleshooting

  • Common issues:

    • Insufficient permissions to delete Jobs in the specified namespaces.
    • Incorrect or missing namespace or Job names in the payload.
    • Network connectivity problems to the Kubernetes API server.
    • Invalid environment identifier leading to targeting the wrong cluster or context.
  • Error messages:

    • Authorization errors indicating lack of permission; resolve by ensuring correct RBAC roles and API credentials.
    • Not found errors if specified Jobs or namespaces do not exist; verify spelling and existence.
    • Timeout or connection errors; check network access and API server availability.

Links and References

Discussion