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

Adding support of ingressClassParams in helm charts #2478

Merged
merged 6 commits into from
Feb 7, 2022

Conversation

haouc
Copy link
Contributor

@haouc haouc commented Jan 27, 2022

Issue

Fixes #2328

Description

We want to add support for ingressClassParams in ingressClass spec parameters in helm charts.

The ingressClassParams was added into values and ingressClass chart. Charts version and README were also updated. Local tests were done from the charts by helm install. The namespaceSelector and group.name were tested with 2048 game ingress.

Update:
Tested for the use cases:

  1. User create ingressClassParams with different spec settings
  2. User doesn't create new ingressClassParams but referring to their existing ingressClassParams.
  3. User create neither new ingressClassParams nor referring to their own resources.
--set ingressClassParams.spec.group.name=test
NAME   CONTROLLER            PARAMETERS                                                      AGE
alb    ingress.k8s.aws/alb   IngressClassParams.elbv2.k8s.aws/aws-load-balancer-controller   8s

--set ingressClassParams.name=dev-test --set ingressClassParams.spec.namespaceSelector.matchLabels.team=team-a
NAME   CONTROLLER            PARAMETERS                                  AGE
alb    ingress.k8s.aws/alb   IngressClassParams.elbv2.k8s.aws/dev-test   8s

Spec:
  Namespace Selector:
    Match Labels:
      Team:  team-a

--set ingressClassParams.name=dev-test --set ingressClassParams.spec.loadBalancerAttributes[0].key=deletion_protection.enabled --set-string ingressClassParams.spec.loadBalancerAttributes[0].value=true --set ingressClassParams.spec.loadBalancerAttributes[1].key=idle_timeout.timeout_seconds --set-string ingressClassParams.spec.loadBalancerAttributes[1].value=120

Spec:
  Load Balancer Attributes:
    Key:    deletion_protection.enabled
    Value:  true
    Key:    idle_timeout.timeout_seconds
    Value:  120


--set ingressClassParams.name=awesome-class --set ingressClassParams.create=false

NAME   CONTROLLER            PARAMETERS                                       AGE
alb    ingress.k8s.aws/alb   IngressClassParams.elbv2.k8s.aws/awesome-class   4s

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 the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Jan 27, 2022
@k8s-ci-robot
Copy link
Contributor

Hi @haouc. Thanks for your PR.

I'm waiting for a kubernetes-sigs 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 cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Jan 27, 2022
@codecov-commenter
Copy link

codecov-commenter commented Jan 27, 2022

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 53.38%. Comparing base (2e8cf3f) to head (449b5e6).
Report is 460 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2478      +/-   ##
==========================================
- Coverage   53.38%   53.38%   -0.01%     
==========================================
  Files         140      140              
  Lines        7985     7988       +3     
==========================================
+ Hits         4263     4264       +1     
- Misses       3405     3406       +1     
- Partials      317      318       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@@ -173,6 +173,7 @@ The default values set by the application itself can be confirmed [here](https:/
| `serviceAccount.name` | Service account to be used | None |
| `terminationGracePeriodSeconds` | Time period for controller pod to do a graceful shutdown | 10 |
| `ingressClass` | The ingress class to satisfy | alb |
| `ingressClassParams.name` | The created ingressClassParams object name (referred in ingressClass) | "" |
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: "" not needed

@@ -87,6 +87,11 @@ enableCertManager: false
# ingresses without ingress class annotation and ingresses of type alb
ingressClass: alb

# The ingressClassParams the ingress class refers to and enforce settings for a set of Ingresses when using with ingress Controller.
ingressClassParams:
Copy link
Collaborator

Choose a reason for hiding this comment

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

why not create IngressClassParams resource and refer from the IngressClass instead? users will be able to specify the ingress class params spec during chart installation

Copy link
Contributor Author

Choose a reason for hiding this comment

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

since the params spec can be user specific and vary, would that be better to let users create ingress class params resources and just refer their name in charts during install/upgrade? That could be easier to maintain and less error-prone?

@@ -87,6 +87,11 @@ enableCertManager: false
# ingresses without ingress class annotation and ingresses of type alb
ingressClass: alb

# The ingressClassParams the ingress class refers to and enforce settings for a set of Ingresses when using with ingress Controller.
Copy link
Collaborator

@kishorj kishorj Jan 27, 2022

Choose a reason for hiding this comment

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

nit: please use the following format for comments

# ingressClassParams specifies the IngressClassParams ...

@kishorj kishorj added the tide/merge-method-squash Denotes a PR that should be squashed by tide when it merges. label Jan 31, 2022
@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Jan 31, 2022
@haouc haouc requested a review from kishorj January 31, 2022 23:21
@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Feb 2, 2022
@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Feb 3, 2022
@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Feb 3, 2022
@@ -7,4 +7,7 @@ metadata:
{{- include "aws-load-balancer-controller.labels" . | nindent 4 }}
spec:
controller: ingress.k8s.aws/alb
{{- if or .Values.ingressClassParams.create .Values.ingressClassParams.name }}
{{ include "aws-load-balancer-controller.ingressClassParameters" . }}
Copy link
Collaborator

Choose a reason for hiding this comment

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

lets include the spec directly instead of using a template function

@haouc haouc requested a review from kishorj February 3, 2022 18:02
@kishorj
Copy link
Collaborator

kishorj commented Feb 3, 2022

/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. approved Indicates a PR has been approved by an approver from all required OWNERS files. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Feb 3, 2022
@kishorj
Copy link
Collaborator

kishorj commented Feb 3, 2022

/retest

@kishorj kishorj removed the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Feb 3, 2022
@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Feb 5, 2022
@haouc haouc requested a review from kishorj February 7, 2022 17:13
Copy link
Collaborator

@kishorj kishorj left a comment

Choose a reason for hiding this comment

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

Thanks for the contribution.

@kishorj
Copy link
Collaborator

kishorj commented Feb 7, 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 Feb 7, 2022
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

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

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 8b7f864 into kubernetes-sigs:main Feb 7, 2022
Timothy-Dougherty pushed a commit to adammw/aws-load-balancer-controller that referenced this pull request Nov 9, 2023
…2478)

* Adding support of ingressClassParams in helm charts

* Update charts to let users to create ingressClassParams with specs

* Simplying the spec in values yaml

* Adding support for customer's ingressClassParams

* Using values fields directly instead of function

* eks1.19 doesn't allow null spec and need move if check out from spec block.
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. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. tide/merge-method-squash Denotes a PR that should be squashed by tide when it merges.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support for IngressClass.spec.parameters and IngressClassParams in Helm chart
4 participants