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

PDB Max Unavailable Field #45587

Merged
merged 5 commits into from
May 23, 2017
Merged

Conversation

foxish
Copy link
Contributor

@foxish foxish commented May 10, 2017

Completes kubernetes/enhancements#285

Adds a MaxUnavailable field to PodDisruptionBudget

Individual commits are self-contained; Last commit can be ignored because it is autogenerated code.
cc @kubernetes/sig-apps-api-reviews @kubernetes/sig-apps-pr-reviews

@foxish foxish added the release-note Denotes a PR that will be considered when it comes time to generate release notes. label May 10, 2017
@foxish foxish self-assigned this May 10, 2017
@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label May 10, 2017
@k8s-reviewable
Copy link

This change is Reviewable

@k8s-github-robot k8s-github-robot added kind/api-change Categorizes issue or PR as related to adding, removing, or otherwise changing an API size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels May 10, 2017
@foxish foxish force-pushed the pdb-maxunavailab branch from 4fb6bf4 to 7710ec7 Compare May 10, 2017 12:54
@0xmichalis
Copy link
Contributor

Make sure you add the extra field as an option in https://github.com/kubernetes/kubernetes/blob/master/pkg/kubectl/cmd/create_pdb.go

@foxish foxish force-pushed the pdb-maxunavailab branch from 7710ec7 to ccb241f Compare May 15, 2017 18:57
@k8s-github-robot k8s-github-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label May 15, 2017
@foxish foxish force-pushed the pdb-maxunavailab branch 2 times, most recently from 877201b to 634f668 Compare May 16, 2017 00:52
@k8s-github-robot k8s-github-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label May 16, 2017
@foxish foxish force-pushed the pdb-maxunavailab branch from 634f668 to e12dfb6 Compare May 16, 2017 00:53
@foxish
Copy link
Contributor Author

foxish commented May 16, 2017

@k8s-bot bazel test this

@foxish foxish force-pushed the pdb-maxunavailab branch 2 times, most recently from a7a2f7d to 3a0211c Compare May 16, 2017 05:32
@foxish
Copy link
Contributor Author

foxish commented May 16, 2017

@k8s-bot kops aws e2e test this

@@ -108,6 +109,11 @@ func DeepCopy_v1beta1_PodDisruptionBudgetSpec(in interface{}, out interface{}, c
in := in.(*PodDisruptionBudgetSpec)
out := out.(*PodDisruptionBudgetSpec)
*out = *in
if in.MinAvailable != nil {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why was this missing before?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was not a pointer field before; we're changing the API (in the first commit) to allow specifying of one of "maxUnavailable" and "minAvailable"

expectedCount += count
}
func (dc *DisruptionController) getExpectedScale(pdb *policy.PodDisruptionBudget, pods []*v1.Pod) (expectedCount int32, err error) {
err = nil
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You don't need this.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@0xmichalis
Copy link
Contributor

/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 May 22, 2017
@erictune
Copy link
Member

/lgtm
/approve
API LGTM.
Good discussion and outcome on validation question.

@foxish foxish force-pushed the pdb-maxunavailab branch from 5e19ae6 to bd2bb60 Compare May 22, 2017 18:49
@k8s-github-robot k8s-github-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label May 22, 2017
// Ensure it supports the generator pattern that uses parameters specified during construction.
var _ StructuredGenerator = &PodDisruptionBudgetV2Generator{}

func (PodDisruptionBudgetV2Generator) ParamNames() []GeneratorParam {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need to implement the Generator interface? @Kargakis
I think we are using StructuredGenerator interface now.

@k8s-github-robot k8s-github-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label May 23, 2017
allErrs = append(allErrs, extensionsvalidation.ValidatePositiveIntOrPercent(spec.MinAvailable, fldPath.Child("minAvailable"))...)
allErrs = append(allErrs, extensionsvalidation.IsNotMoreThan100Percent(spec.MinAvailable, fldPath.Child("minAvailable"))...)
if spec.MinAvailable != nil && spec.MaxUnavailable != nil {
allErrs = append(allErrs, field.Invalid(fldPath, spec, "MinAvailable and MaxUnavailable cannot be both set"))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these should be camelCase minAvailable and maxUnavailable

@smarterclayton
Copy link
Contributor

One comment, then LGTM

@foxish foxish force-pushed the pdb-maxunavailab branch from bd2bb60 to 1110e63 Compare May 23, 2017 14:17
@foxish foxish force-pushed the pdb-maxunavailab branch from 1110e63 to 48d76ed Compare May 23, 2017 14:42
@k8s-github-robot k8s-github-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label May 23, 2017
@foxish
Copy link
Contributor Author

foxish commented May 23, 2017

@smarterclayton Updated and rebased.

@smarterclayton
Copy link
Contributor

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label May 23, 2017
@k8s-github-robot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: erictune, foxish, kargakis, smarterclayton

Needs approval from an approver in each of these OWNERS Files:

You can indicate your approval by writing /approve in a comment
You can cancel your approval by writing /approve cancel in a comment

@k8s-github-robot k8s-github-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label May 23, 2017
@k8s-ci-robot
Copy link
Contributor

k8s-ci-robot commented May 23, 2017

@foxish: The following test(s) failed:

Test name Commit Details Rerun command
pull-kubernetes-federation-e2e-gce 48d76ed link @k8s-bot pull-kubernetes-federation-e2e-gce test this

Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

@foxish
Copy link
Contributor Author

foxish commented May 23, 2017

@k8s-bot pull-kubernetes-e2e-gce-etcd3 test this

@k8s-github-robot
Copy link

Automatic merge from submit-queue (batch tested with PRs 45587, 46286)

@k8s-github-robot k8s-github-robot merged commit 1602e2a into kubernetes:master May 23, 2017
@foxish foxish deleted the pdb-maxunavailab branch May 23, 2017 17:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. 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 lgtm "Looks good to me", indicates that a PR is ready to be merged. release-note Denotes a PR that will be considered when it comes time to generate release notes. sig/apps Categorizes an issue or PR as relevant to SIG Apps. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.