Skip to content

Add conditions to PDB status#98127

Merged
k8s-ci-robot merged 2 commits intokubernetes:masterfrom
mortent:AddConditionsToPDBs
Mar 5, 2021
Merged

Add conditions to PDB status#98127
k8s-ci-robot merged 2 commits intokubernetes:masterfrom
mortent:AddConditionsToPDBs

Conversation

@mortent
Copy link
Copy Markdown
Member

@mortent mortent commented Jan 17, 2021

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 the status.DisruptionsAllowed field, but with this condition we can also communicate the reason why the value of status.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?:

PodDisruptionBudget API objects can now contain conditions in status.

Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.:

@kubernetes/sig-apps-pr-reviews

@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. kind/feature Categorizes issue or PR as related to a new feature. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. kind/api-change Categorizes issue or PR as related to adding, removing, or otherwise changing an API cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. sig/apps Categorizes an issue or PR as relevant to SIG Apps. sig/auth Categorizes an issue or PR as relevant to SIG Auth. and removed do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels Jan 17, 2021
@mortent
Copy link
Copy Markdown
Member Author

mortent commented Jan 17, 2021

/test pull-kubernetes-e2e-kind

@mortent mortent changed the title Add conditions to pd bs Add conditions to PDB status Jan 18, 2021
@fejta-bot
Copy link
Copy Markdown

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.

@mortent
Copy link
Copy Markdown
Member Author

mortent commented Jan 31, 2021

/assign @smarterclayton

@liggitt liggitt added this to the v1.21 milestone Feb 18, 2021
Copy link
Copy Markdown
Contributor

@soltysh soltysh left a 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

@k8s-ci-robot k8s-ci-robot added triage/accepted Indicates an issue or PR is ready to be actively worked on. priority/backlog Higher priority than priority/awaiting-more-evidence. api-review Categorizes an issue or PR as actively needing an API review. and removed needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. labels Feb 22, 2021
@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Feb 22, 2021
Copy link
Copy Markdown
Member

@liggitt liggitt left a 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?

Comment thread pkg/controller/disruption/disruption_test.go Outdated
Comment thread staging/src/k8s.io/api/policy/v1beta1/types.go Outdated
Comment thread pkg/controller/disruption/disruption.go Outdated
Comment thread pkg/controller/disruption/disruption.go Outdated
@liggitt liggitt assigned liggitt and unassigned smarterclayton Feb 23, 2021
@mortent
Copy link
Copy Markdown
Member Author

mortent commented Feb 25, 2021

/test pull-kubernetes-node-e2e
/test pull-kubernetes-unit

@mortent
Copy link
Copy Markdown
Member Author

mortent commented Feb 25, 2021

/test pull-kubernetes-unit

Comment thread pkg/apis/policy/validation/validation.go Outdated
Comment thread pkg/apis/policy/validation/validation.go Outdated
Comment thread pkg/apis/policy/validation/validation.go Outdated
Comment thread pkg/registry/policy/poddisruptionbudget/strategy.go Outdated
Comment thread pkg/registry/policy/poddisruptionbudget/strategy.go Outdated
@mortent mortent force-pushed the AddConditionsToPDBs branch 2 times, most recently from 4a35573 to d720be4 Compare March 4, 2021 05:46
@k8s-ci-robot k8s-ci-robot added area/apiserver area/cloudprovider area/dependency Issues or PRs related to dependency changes area/kubectl sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. sig/cli Categorizes an issue or PR as relevant to SIG CLI. sig/cloud-provider Categorizes an issue or PR as relevant to SIG Cloud Provider. sig/cluster-lifecycle Categorizes an issue or PR as relevant to SIG Cluster Lifecycle. sig/instrumentation Categorizes an issue or PR as relevant to SIG Instrumentation. labels Mar 4, 2021
@mortent mortent force-pushed the AddConditionsToPDBs branch from d720be4 to 902ba94 Compare March 4, 2021 06:22
Comment thread staging/src/k8s.io/api/policy/v1beta1/types.go Outdated
Comment thread staging/src/k8s.io/api/policy/v1beta1/types.go Outdated
Comment thread staging/src/k8s.io/api/policy/v1beta1/types.go Outdated
Comment thread staging/src/k8s.io/api/policy/v1beta1/types.go Outdated
Comment thread staging/src/k8s.io/api/policy/v1beta1/types.go Outdated
Comment thread pkg/apis/policy/validation/validation.go Outdated
Comment thread pkg/registry/policy/poddisruptionbudget/strategy.go Outdated
Comment thread pkg/controller/disruption/disruption.go Outdated
Copy link
Copy Markdown
Member

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

Comment thread pkg/registry/core/pod/storage/eviction.go Outdated
Comment thread staging/src/k8s.io/component-helpers/apps/poddisruptionbudget/helpers.go Outdated
@mortent mortent force-pushed the AddConditionsToPDBs branch 2 times, most recently from 1ec6719 to b01d20d Compare March 4, 2021 20:30
@mortent
Copy link
Copy Markdown
Member Author

mortent commented Mar 4, 2021

/test pull-kubernetes-unit

@mortent
Copy link
Copy Markdown
Member Author

mortent commented Mar 4, 2021

@liggitt I have addressed the comments.

@mortent
Copy link
Copy Markdown
Member Author

mortent commented Mar 4, 2021

/test pull-kubernetes-e2e-gce-ubuntu-containerd

@mortent mortent force-pushed the AddConditionsToPDBs branch from b01d20d to b08eb95 Compare March 5, 2021 03:03
@liggitt
Copy link
Copy Markdown
Member

liggitt commented Mar 5, 2021

/lgtm
/approve

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Mar 5, 2021
@k8s-ci-robot
Copy link
Copy Markdown
Contributor

[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

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Mar 5, 2021
@k8s-ci-robot k8s-ci-robot merged commit 7a49140 into kubernetes:master Mar 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api-review Categorizes an issue or PR as actively needing an API review. approved Indicates a PR has been approved by an approver from all required OWNERS files. area/apiserver area/cloudprovider area/dependency Issues or PRs related to dependency changes area/kubectl cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/api-change Categorizes issue or PR as related to adding, removing, or otherwise changing an API kind/feature Categorizes issue or PR as related to a new feature. lgtm "Looks good to me", indicates that a PR is ready to be merged. priority/backlog Higher priority than priority/awaiting-more-evidence. release-note Denotes a PR that will be considered when it comes time to generate release notes. sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. sig/apps Categorizes an issue or PR as relevant to SIG Apps. sig/auth Categorizes an issue or PR as relevant to SIG Auth. sig/cli Categorizes an issue or PR as relevant to SIG CLI. sig/cloud-provider Categorizes an issue or PR as relevant to SIG Cloud Provider. sig/cluster-lifecycle Categorizes an issue or PR as relevant to SIG Cluster Lifecycle. sig/instrumentation Categorizes an issue or PR as relevant to SIG Instrumentation. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. triage/accepted Indicates an issue or PR is ready to be actively worked on.

Projects

Status: API review completed, 1.21

Development

Successfully merging this pull request may close these issues.

7 participants