Skip to content

Agent should create PodDisruptionBudget for running pipelines #7038

Description

@DHandspikerWade

Clear and concise description of the problem

When using the Kubernetes backend, a pipeline steps is at risk of being evicted during cluster auto-scaling.

When the pod is evicted, the agent treats the step as completed successfully (the web UI reports "Exit Code 0"). This allows further steps to attempt to run without actually having completed earlier steps.

Suggested solution

When the agent is creating Pods, it should also create a matching PodDisruptionBudget with maxUnavailable set to zero to avoid any voluntary evictions. The Pod should be added as an owner to the PodDisruptionBudget so that once the step terminates, the PBD will be garbage collected by the Kubernetes scheduler.

Alternative

No response

Additional context

No response

Validations

  • Checked that the feature isn't part of the next version already [https://woodpecker-ci.org/versions]
  • Read the docs.
  • Check that there isn't already an issue that request the same feature to avoid creating a duplicate.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions