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
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion stable/nginx-ingress/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: nginx-ingress
version: 0.3.0
version: 0.3.1
description: An nginx Ingress controller that uses ConfigMap to store the nginx configuration.
icon: https://upload.wikimedia.org/wikipedia/commons/thumb/c/c5/Nginx_logo.svg/500px-Nginx_logo.svg.png
keywords:
Expand Down
2 changes: 2 additions & 0 deletions stable/nginx-ingress/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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?

`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.

`controller.extraArgs` | Additional controller container arguments | `{}`
`controller.kind` | install as Deployment or DaemonSet | `Deployment`
`controller.nodeSelector` | node labels for pod assignment | `{}`
Expand Down
3 changes: 3 additions & 0 deletions stable/nginx-ingress/templates/controller-daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 .Values.controller.scope.enabled }}
- --watch-namespace={{ default .Release.Namespace .Values.controller.scope.namespace }}
{{- end }}
{{- range $key, $value := .Values.controller.extraArgs }}
- --{{ $key }}={{ $value }}
{{- end }}
Expand Down
3 changes: 3 additions & 0 deletions stable/nginx-ingress/templates/controller-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 .Values.controller.scope.enabled }}
- --watch-namespace={{ default .Release.Namespace .Values.controller.scope.namespace }}
{{- end }}
{{- range $key, $value := .Values.controller.extraArgs }}
- --{{ $key }}={{ $value }}
{{- end }}
Expand Down
6 changes: 6 additions & 0 deletions stable/nginx-ingress/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@ controller:
##
defaultBackendService: ""

## Limit the scope of the controller
##
scope:
enabled: false
namespace: "" # defaults to .Release.Namespace

extraArgs: {}

## DaemonSet or Deployment
Expand Down