-
Notifications
You must be signed in to change notification settings - Fork 16.8k
[stable/nginx-ingress]: add option to specify the scope #775
Conversation
sdomula
commented
Mar 10, 2017
- option to enable scoped ingress contoller (defaults to the namespace of the helm release)
- option to specify a namespace
* option to enable scoped ingress contoller (defaults to the namespace of the helm release * option to specify a namespace
Hi @sdomula. 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 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. |
Thanks for your pull request. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). 📝 Please follow instructions at https://github.com/kubernetes/kubernetes/wiki/CLA-FAQ to sign the CLA. Once you've signed, please reply here (e.g. "I signed it!") and we'll verify. Thanks.
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. |
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.
Just a couple style requests. Otherwise LGTM.
@@ -31,6 +31,9 @@ spec: | |||
- --nginx-configmap={{ .Release.Namespace }}/{{ template "controller.fullname" . }} | |||
- --tcp-services-configmap={{ .Release.Namespace }}/{{ template "fullname" . }}-tcp | |||
- --udp-services-configmap={{ .Release.Namespace }}/{{ template "fullname" . }}-udp | |||
{{- if eq .Values.controller.scope.enabled true }} |
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.
Just checking a bool here, so {{- if .Values.controller.scope.enabled }}
will suffice.
@@ -32,6 +32,9 @@ spec: | |||
- --nginx-configmap={{ .Release.Namespace }}/{{ template "controller.fullname" . }} | |||
- --tcp-services-configmap={{ .Release.Namespace }}/{{ template "fullname" . }}-tcp | |||
- --udp-services-configmap={{ .Release.Namespace }}/{{ template "fullname" . }}-udp | |||
{{- if eq .Values.controller.scope.enabled true }} |
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.
As above, this conditional can be simplified.
@sdomula We just need the CLA and it'll get merged. Thanks for the contribution! |
I need to wait until the CLA page is up again. I posted the issue here: kubernetes/kubernetes#27796 (comment) |
I signed it! |
Why not just use |
@@ -51,6 +51,8 @@ Parameter | Description | Default | |||
`controller.image.pullPolicy` | controller container image pull policy | `IfNotPresent` | |||
`controller.config` | nginx ConfigMap entries | none | |||
`controller.defaultBackendService` | default 404 backend service; required only if `defaultBackend.enabled = false` | `""` | |||
`controller.scope.enabled` | limit the scope of the ingress controller | `false` (watch all namespaces) |
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.
This is unnecessary, just set the default for controller.scope.namespace
to all
. This is the default behavior for the controller already, no need to have conditionals.
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.
My goal was to have all
as the default (same behavior as current master) and add the option to set it to {{ .Release.Namespace }}
. Maybe you can point me to a better solution. I have not figured out a better way to achieve that.
Is there a way to override variables of a chart dependency with templates?
@@ -51,6 +51,8 @@ Parameter | Description | Default | |||
`controller.image.pullPolicy` | controller container image pull policy | `IfNotPresent` | |||
`controller.config` | nginx ConfigMap entries | none | |||
`controller.defaultBackendService` | default 404 backend service; required only if `defaultBackend.enabled = false` | `""` | |||
`controller.scope.enabled` | limit the scope of the ingress controller | `false` (watch all namespaces) | |||
`controller.scope.namespace` | namespace to watch for ingress | `""` (use the release namespace) |
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.
Why not just controller.watchNamespace
?
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.
My intention was to add the possibility to limit the scope of the ingress controller to the namespace of the helm chart release, to avoid hard coding the namespace, e.g, in a wrapper helm chart.
As a note: nginx-ingress got another pre-release This PR need not be updated for the above issue, but just a heads up if you try the new image, you'll run into this. |
Thank you @sdomula! |
* stable/nginx-ingress: add option to specify the scope * option to enable scoped ingress contoller (defaults to the namespace of the helm release * option to specify a namespace * simplify bool check * Version bump