Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: Support Pod Failure Policy for Jobs / Cronjobs #2374

Closed
snorlaX-sleeps opened this issue Dec 20, 2023 · 3 comments · Fixed by #2394
Closed

Feature Request: Support Pod Failure Policy for Jobs / Cronjobs #2374

snorlaX-sleeps opened this issue Dec 20, 2023 · 3 comments · Fixed by #2394

Comments

@snorlaX-sleeps
Copy link

Description

Add Pod Failure Policy configuration to the Kubernetes Job Spec.
As this is only GA in Kubernetes v1.29 I can understand why it may not already be available.

This feature allows handling different kinds of error states and if it is counted towards the backoffLimit.

Potential Terraform Configuration

Using the example from the linked documentation:

pod_failure_policy {
  rule {
    action = "FailJob"
    on_exit_codes = {
      container_name = "main"
      operator       = "In"
      values         = [42]
    }
  }
  rule {
    action = "Ignore"
    on_pod_conditions = {
      type = "DisruptionTarget"
    }
  }
}

References

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment
@BBBmau
Copy link
Contributor

BBBmau commented Jan 12, 2024

Support for PodFailurePolicy is only found in the job schema and not in cronjob schema.

@snorlaX-sleeps
Copy link
Author

@BBBmau - as a cronjob contains a job template, would it be included there? (are all job features not available to a cronjob?)
Thanks for making a PR

@BBBmau
Copy link
Contributor

BBBmau commented Jan 12, 2024

@snorlaX-sleeps Yes since cronjob uses job template it would already be included since it uses the same jobSpec found in the job resource. Thanks for bringing this up, because of this cronjob tests will need to include the checking of job_template to include PodFailurePolicy.

Latest commit includes that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants