Skip to content

fix failures during upgrade when using the default provided IngressClass and IngressClassParam #2732

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

Merged
merged 1 commit into from
Jul 26, 2022

Conversation

M00nF1sh
Copy link
Collaborator

@M00nF1sh M00nF1sh commented Jul 22, 2022

Issue

#2731

Description

This change will disable usage of IngressClassParams in the default provided "alb" IngressClass by default(unless the IngressClassParams have name/spec customized)

The IngressClassParams will continue to be created by default as well to avoid potential race conditions while update from a version that were already using the alb IngressClassParams

Also, if IngressClassParams is been used by IngressClass, the change will create the IngressClassParams first[this is not 100% safe since Kubernetes don't guarantee controllers receive events about different objects in order, a controller change is needed for it, see #2731]

The IngressClassParams will only be used by the default provided "alb" IngressClass when one of following condition is true:

  1. IngressClassParams.create == false and IngressClassParams.name != "", this means the "alb" IngressClass will be configured to use a pre-exists IngressClassParams.
  2. IngressClassParams.create == false and (IngressClassParams.name != "" or IngressClassParams.spec != {}), this means the "alb" IngressClass will be configured to use a new created IngressClassParams that have customizations. (otherwise, there is no need to make alb IngressClass reference the IngressClassParams if there is no customization)

Upgrade scenarios:

  • For users with helmChart version < v1.3.1:
    • currently they have no default-provided IngressClass nor IngressClassParams
    • after upgrade to version with this fix, there will be alb IngressClass and alb IngressClassParams created, and the alb is not configured to use the alb IngressClassParams. [this is safe]
  • For users with helmChart version 1.3.1-1.3.3
    • currently they have the default provided "alb" IngressClass.
    • after upgrade to version with this fix under default configurations, the default provided "alb" IngressClass will have no change, while a new "alb" IngressClassParams will be created but not used. [this is safe]
    • after upgrade to version with this fix while override the newly provided ingressClassParams.spec, the default provided "alb" IngressClass will be configured to use the newly created "alb" IngressClassParam after its creation. [in theory this may not be safe, but should be fine as we don't expect users to explicitly modify the default provided IngressClassParams while have Ingresses currently using it]
  • For users with helmChart version 1.4.0-1.4.2
    • currently they have the default-provided alb IngressClass and alb IngressClassParams
    • after upgrade to version with this fix under default configurations, the default provided "alb" IngressClass will be modified to no longer use the alb IngressClassParams. [this is safe since using a IngressClassParams without configuration is same as don't use IngressClassParams]
    • after upgrade to version with this fix while while override the newly provided ingressClassParams.spec, no change will done.

Checklist

  • Added tests that cover your change (if possible)
  • Added/modified documentation as required (such as the README.md, or the docs directory)
  • Manually tested
  • Made sure the title of the PR is a good description that can go into the release notes

BONUS POINTS checklist: complete for good vibes and maybe prizes?! 🤯

  • Backfilled missing tests for code in same general area 🎉
  • Refactored something and made the world a better place 🌟

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Jul 22, 2022
@k8s-ci-robot k8s-ci-robot requested a review from kishorj July 22, 2022 22:33
@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jul 22, 2022
@M00nF1sh M00nF1sh changed the title fix creation order of ingressClass and ingressClassParams and by default don't link IngressClass to IngressClassParams fix failures during upgrade when using the default provided IngressClass and IngressClassParam Jul 22, 2022
@kishorj
Copy link
Collaborator

kishorj commented Jul 26, 2022

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jul 26, 2022
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: kishorj, M00nF1sh

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 merged commit 2edc214 into kubernetes-sigs:main Jul 26, 2022
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. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants