-
Notifications
You must be signed in to change notification settings - Fork 40k
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
Add conditions to PDB status #98127
Add conditions to PDB status #98127
Conversation
/test pull-kubernetes-e2e-kind |
This PR may require API review. If so, when the changes are ready, complete the pre-review checklist and request an API review. Status of requested reviews is tracked in the API Review project. |
/assign @smarterclayton |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
/approve
/triage accepted
/priority backlog
/label api-review
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
EvictionREST#checkAndDecrement updates PDB status... should it set this condition as well?
4a35573
to
d720be4
Compare
d720be4
to
902ba94
Compare
@@ -777,9 +780,21 @@ func (dc *DisruptionController) buildDisruptedPodMap(pods []*v1.Pod, pdb *policy | |||
// implement the "fail open" part of the design since if we manage to update | |||
// this field correctly, we will prevent the /evict handler from approving an | |||
// eviction when it may be unsafe to do so. | |||
func (dc *DisruptionController) failSafe(pdb *policy.PodDisruptionBudget) error { | |||
func (dc *DisruptionController) failSafe(pdb *policy.PodDisruptionBudget, err error) error { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
addressing this in a separate PR sounds good to me. I don't think this change makes the issue worse, and gives us a potential tool to address the issue in a follow up
staging/src/k8s.io/component-helpers/apps/poddisruptionbudget/helpers.go
Show resolved
Hide resolved
1ec6719
to
b01d20d
Compare
/test pull-kubernetes-unit |
@liggitt I have addressed the comments. |
/test pull-kubernetes-e2e-gce-ubuntu-containerd |
b01d20d
to
b08eb95
Compare
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: liggitt, mortent, soltysh The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
What type of PR is this?
/kind feature
/kind api-change
What this PR does / why we need it:
This adds a conditions field to the PDB status object and updates the disruption controller to use the
DisruptionAllowed
condition. This provides information that to some extent is already available through thestatus.DisruptionsAllowed
field, but with this condition we can also communicate the reason why the value ofstatus.DisruptionsAllowed
are set to 0. This can be either because not enough pods are available, or because the disruption controller experienced an error.This addresses one of the issues described in the PDB to GA KEP: kubernetes/enhancements#2114
Which issue(s) this PR fixes:
Special notes for your reviewer:
Does this PR introduce a user-facing change?:
Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.:
@kubernetes/sig-apps-pr-reviews