Skip to content
This repository has been archived by the owner on Feb 22, 2022. It is now read-only.

[stable/nginx-ingress]: add option to specify the scope #775

Merged
merged 3 commits into from
Mar 17, 2017

Conversation

sdomula
Copy link
Contributor

@sdomula 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
@k8s-ci-robot
Copy link
Contributor

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 @k8s-bot 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.

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.

@k8s-ci-robot
Copy link
Contributor

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.

@k8s-ci-robot k8s-ci-robot added the cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. label Mar 10, 2017
Copy link
Contributor

@mgoodness mgoodness left a 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 }}
Copy link
Contributor

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 }}
Copy link
Contributor

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.

@mgoodness mgoodness self-assigned this Mar 10, 2017
@mgoodness mgoodness changed the title stable/nginx-ingress: add option to sepcify the scope [stable/nginx-ingress]: add option to specify the scope Mar 10, 2017
@mgoodness mgoodness added code reviewed UX reviewed lgtm Indicates that a PR is ready to be merged. and removed changes needed labels Mar 10, 2017
@mgoodness
Copy link
Contributor

@sdomula We just need the CLA and it'll get merged. Thanks for the contribution!

@sdomula
Copy link
Contributor Author

sdomula commented Mar 10, 2017

I need to wait until the CLA page is up again. I posted the issue here: kubernetes/kubernetes#27796 (comment)

@sdomula
Copy link
Contributor Author

sdomula commented Mar 10, 2017

I signed it!

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. and removed cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. labels Mar 10, 2017
@mgoodness mgoodness removed their assignment Mar 10, 2017
@chancez
Copy link
Contributor

chancez commented Mar 10, 2017

Why not just use controller.extraArgs? This seems reasonable, but seems a bit unnecessary perhaps.

@@ -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)
Copy link
Contributor

@chancez chancez Mar 10, 2017

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.

Copy link
Contributor Author

@sdomula sdomula Mar 11, 2017

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)
Copy link
Contributor

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?

Copy link
Contributor Author

@sdomula sdomula Mar 10, 2017

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.

@mgoodness mgoodness removed the lgtm Indicates that a PR is ready to be merged. label Mar 10, 2017
@mgoodness mgoodness self-assigned this Mar 10, 2017
@chancez
Copy link
Contributor

chancez commented Mar 14, 2017

As a note: nginx-ingress got another pre-release 0.9.0-beta.3. However, it has an issue, as described here: kubernetes/ingress-nginx#443. I believe the existing chart behavior of specifying the configmaps I probably correct (or at least, its not wrong), but it will cause usage of this chart with 0.9.0-beta.3 to result in a crashing looping ingress controller, as it will error when it cannot find the tcp/udp service configmaps.

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.

@seanknox seanknox merged commit d120384 into helm:master Mar 17, 2017
@seanknox
Copy link
Contributor

Thank you @sdomula!

yanns pushed a commit to yanns/charts that referenced this pull request Jul 28, 2017
* 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
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. code reviewed UX reviewed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants