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
Chart: Add alias IngressClass
resources.
#10614
Conversation
✅ Deploy Preview for kubernetes-ingress-nginx canceled.
|
Welcome @slimm609! |
Hi @slimm609. 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 Once the patch is verified, the new status will be reflected by the 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. |
cc: @rikatz |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
inb4: I'm just a regular contributor, so please don't get me wrong, I'm just asking questions which came into my mind when reading your PR and added some chances for improvement.
I basically like the idea of having multiple IngressClasses configured with one chart! What I'm not understanding is the need for the tplvalues.render
template.
As far as I understand this complex bit of code, it's mostly used for templating some value - the commonLabels
in this particular case - in a specific context defined by scope
. Right now we are not making use of this and there are way easier approaches to do so.
What's wrong about just making ingressClassResource
an array and iterate over it? Yes, it's breaking, but it's simple, clean and keeps the possibility of configuring IngressClasses
separately, especially their parameters. Of course the controllerValue
could not be part of the array then.
6c456df
to
ac09ec8
Compare
I was able to rework to avoid the template issue. Switching to an array is a breaking change which I was trying to avoid as this likely won't be a common use-case. Contour supports the same thing in a similar way as well |
7f802f2
to
47365b0
Compare
Yes, sure, using an array would be breaking and I think the way you're implementing it right now is the best compromise. Maybe this can be converted to an array in a later major release. For now you could also just add a WDYT? |
7b9d1e9
to
5185d3e
Compare
OK. Updated to use the values from
|
592df29
to
cdff263
Compare
@tao12345666333 this should be ready to go now |
/ok-to-test @Gacko as you've been also helping on this review, is this fine for you? |
Signed-off-by: slimm609 <dbrian@vmware.com>
cdff263
to
2383f63
Compare
- change to support extraNames instead of splitting string Signed-off-by: slimm609 <dbrian@vmware.com>
2383f63
to
43fc43e
Compare
@cpanato Do you have a reference of where there is a test case for the existing ingressClass? |
/assign |
Regarding the tests: Have a look into this directory. This manifest could be a good starting point. I know we already changed the name of the property once. But what do you think about Regarding the new IngressClass manifest: Could we either name it |
@@ -0,0 +1,18 @@ | |||
{{- if and (.Values.controller.ingressClassResource.enabled) (.Values.controller.ingressClassResource.extraNames) -}} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
{{- if and (.Values.controller.ingressClassResource.enabled) (.Values.controller.ingressClassResource.extraNames) -}} | |
{{- if and .Values.controller.ingressClassResource.enabled .Values.controller.ingressClassResource.aliases -}} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left a last bunch of suggestions. If you agree on naming the new variable aliases
, please also rename the controller-extraingressclass.yaml
to controller-ingressclass-aliases.yaml
. That would be nice! Apart from that we should be ready to merge. 🙂
# -- Additional ingressClass names | ||
extraNames: [] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# -- Additional ingressClass names | |
extraNames: [] | |
# -- Aliases for the ingressClass | |
aliases: [] |
@@ -331,6 +331,7 @@ As of version `1.26.0` of this chart, by simply not providing any clusterIP valu | |||
| controller.ingressClassResource.controllerValue | string | `"k8s.io/ingress-nginx"` | Controller-value of the controller that is processing this ingressClass | | |||
| controller.ingressClassResource.default | bool | `false` | Is this the default ingressClass for the cluster | | |||
| controller.ingressClassResource.enabled | bool | `true` | Is this ingressClass enabled or not | | |||
| controller.ingressClassResource.extraNames | list | `[]` | Additional ingressClass names | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| controller.ingressClassResource.extraNames | list | `[]` | Additional ingressClass names | | |
| controller.ingressClassResource.aliases | list | `[]` | Aliases for the ingressClass | |
You probably need to re-run helm-docs
here.
@@ -0,0 +1,18 @@ | |||
{{- if and (.Values.controller.ingressClassResource.enabled) (.Values.controller.ingressClassResource.extraNames) -}} | |||
{{- range $v := .Values.controller.ingressClassResource.extraNames }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
{{- range $v := .Values.controller.ingressClassResource.extraNames }} | |
{{- range $v := .Values.controller.ingressClassResource.aliases }} |
/kind feature |
IngressClass
aliases.
/retitle Chart: Add alias |
IngressClass
aliases.IngressClass
resources.
Closing this in favor of #11109. /close |
@Gacko: Closed this PR. In response to this:
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. |
Add support for multiple ingress class names on a single controller
What this PR does / why we need it:
This allows supporting multiple ingress class names in a behind a single controller. The use case is that in production, there are multiple different ingress classes like internal and external. However, in limited development environments there is no "internal" vs "external" so this allows using a single controller for resource usage reductions and still provides the "look" of multiple ingress classes.
Types of changes
How Has This Been Tested?
This was tested with nginx 1.9.3. The controller supports it but the helm chart did not.
Checklist: