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

[helm] PodDisruptionBudget spec logic update for controller.maxUnavailable #9904

Merged
merged 1 commit into from
May 25, 2023

Conversation

balonik
Copy link
Contributor

@balonik balonik commented Apr 26, 2023

What this PR does / why we need it:

Allow to specify both controller.minAvailable and controller.maxUnavailable. minAvailable will be ignored if maxUnavailable is set. Removes the need to set minAvailable: null in chart's values if maxUnavailable is desired instead.
This is especially helpful when using Kustomize which handles null values in a special way (ref: kubernetes-sigs/kustomize#4628) and therefore it's impossible to "unset" controller.minAvailable from chart's default values. Related issue in Flux CD fluxcd/kustomize-controller#372

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • CVE Report (Scanner found CVE and adding report)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation only

Which issue/s this PR fixes

fixes #9625

How Has This Been Tested?

Checklist:

  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I've read the CONTRIBUTION guide
  • I have added unit and/or e2e tests to cover my changes.
  • All new and existing tests passed.
  • Added Release Notes.
NONE

@k8s-ci-robot k8s-ci-robot added the needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. label Apr 26, 2023
@k8s-ci-robot
Copy link
Contributor

This issue is currently awaiting triage.

If Ingress contributors determines this is a relevant issue, they will accept it by applying the triage/accepted label and provide further guidance.

The triage/accepted label can be added by org members by writing /triage accepted in a comment.

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.

@k8s-ci-robot
Copy link
Contributor

Welcome @balonik!

It looks like this is your first PR to kubernetes/ingress-nginx 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes/ingress-nginx has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. 😃

@k8s-ci-robot k8s-ci-robot added needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. needs-kind Indicates a PR lacks a `kind/foo` label and requires one. labels Apr 26, 2023
@k8s-ci-robot
Copy link
Contributor

Hi @balonik. Thanks for your PR.

I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

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.

@k8s-ci-robot k8s-ci-robot added needs-priority cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Apr 26, 2023
@k8s-ci-robot k8s-ci-robot added size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. area/helm Issues or PRs related to helm charts labels Apr 26, 2023
@balonik balonik changed the title Helm Chart PodDisruptionBudget spec logic update for controller.maxUnavailable [helm] PodDisruptionBudget spec logic update for controller.maxUnavailable Apr 26, 2023
@balonik
Copy link
Contributor Author

balonik commented Apr 26, 2023

This change does NOT break existing behavior.

Examples:
default values controller.minAvailable: 1, controller.maxUnavailable unset (commented out)
expected: minAvailable: 1
got: minAvailable: 1

---
# Source: ingress-nginx/templates/controller-poddisruptionbudget.yaml
apiVersion: policy/v1
kind: PodDisruptionBudget
metadata:
  labels:
    helm.sh/chart: ingress-nginx-4.6.0
    app.kubernetes.io/name: ingress-nginx
    app.kubernetes.io/instance: release-name
    app.kubernetes.io/version: "1.7.0"
    app.kubernetes.io/part-of: ingress-nginx
    app.kubernetes.io/managed-by: Helm
    app.kubernetes.io/component: controller
  name: release-name-ingress-nginx-controller
  namespace: ingress
spec:
  selector:
    matchLabels:
      app.kubernetes.io/name: ingress-nginx
      app.kubernetes.io/instance: release-name
      app.kubernetes.io/component: controller
  minAvailable: 1

controller.minAvailable: null, controller.maxUnavailable: 1 (currently only way how to do it)
expected: maxUnavailable: 1
got: maxUnavailable: 1

---
# Source: ingress-nginx/templates/controller-poddisruptionbudget.yaml
apiVersion: policy/v1
kind: PodDisruptionBudget
metadata:
  labels:
    helm.sh/chart: ingress-nginx-4.6.0
    app.kubernetes.io/name: ingress-nginx
    app.kubernetes.io/instance: release-name
    app.kubernetes.io/version: "1.7.0"
    app.kubernetes.io/part-of: ingress-nginx
    app.kubernetes.io/managed-by: Helm
    app.kubernetes.io/component: controller
  name: release-name-ingress-nginx-controller
  namespace: ingress
spec:
  selector:
    matchLabels:
      app.kubernetes.io/name: ingress-nginx
      app.kubernetes.io/instance: release-name
      app.kubernetes.io/component: controller
  maxUnavailable: 1

controller.minAvailable: 1, controller.maxUnavailable: 1 (new way how it can be done)
expected: maxUnavailable: 1
got: maxUnavailable: 1

---
# Source: ingress-nginx/templates/controller-poddisruptionbudget.yaml
apiVersion: policy/v1
kind: PodDisruptionBudget
metadata:
  labels:
    helm.sh/chart: ingress-nginx-4.6.0
    app.kubernetes.io/name: ingress-nginx
    app.kubernetes.io/instance: release-name
    app.kubernetes.io/version: "1.7.0"
    app.kubernetes.io/part-of: ingress-nginx
    app.kubernetes.io/managed-by: Helm
    app.kubernetes.io/component: controller
  name: release-name-ingress-nginx-controller
  namespace: ingress
spec:
  selector:
    matchLabels:
      app.kubernetes.io/name: ingress-nginx
      app.kubernetes.io/instance: release-name
      app.kubernetes.io/component: controller
  maxUnavailable: 1

@balonik
Copy link
Contributor Author

balonik commented May 22, 2023

any feedback would be greatly appreciated

@strongjz
Copy link
Member

@balonik can you rebase to get the 1.27 tests?

Looks good to me, just need to update for the tests.

@strongjz
Copy link
Member

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels May 25, 2023
Signed-off-by: Peter Jakubis <balonik32@gmail.com>
@balonik
Copy link
Contributor Author

balonik commented May 25, 2023

@strongjz rebased and tests passed

@strongjz
Copy link
Member

/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 25, 2023
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: balonik, strongjz

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 /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 May 25, 2023
@k8s-ci-robot k8s-ci-robot merged commit df0be08 into kubernetes:main May 25, 2023
34 checks passed
@jukie jukie mentioned this pull request Jun 22, 2023
10 tasks
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. area/helm Issues or PRs related to helm charts cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. needs-kind Indicates a PR lacks a `kind/foo` label and requires one. needs-priority needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unexpected behaviour around controller.minAvailable and controller.maxUnavailable parameters
3 participants