[stable/nginx-ingress] Add support for extraContainers, extraVolumeMounts and extraVolumes (#3983)

This commit is contained in:
Mathieu Parent
2018-04-06 06:57:09 -07:00
committed by k8s-ci-robot
parent ef9956a940
commit 030910039c
5 changed files with 68 additions and 5 deletions
+1 -1
View File
@@ -1,5 +1,5 @@
name: nginx-ingress
version: 0.12.3
version: 0.13.0
appVersion: 0.12.0
home: https://github.com/kubernetes/ingress-nginx
description: An nginx Ingress controller that uses ConfigMap to store the nginx configuration.
+3
View File
@@ -54,6 +54,9 @@ Parameter | Description | Default
`controller.defaultBackendService` | default 404 backend service; required only if `defaultBackend.enabled = false` | `""`
`controller.electionID` | election ID to use for the status update | `ingress-controller-leader`
`controller.extraEnvs` | any additional environment variables to set in the pods | `{}`
`controller.extraContainers` | Sidecar containers to add to the controller pod. See [LemonLDAP::NG controller](https://github.com/lemonldap-ng-controller/lemonldap-ng-controller) as example | `{}`
`controller.extraVolumeMounts` | Additional volumeMounts to the controller main container | `{}`
`controller.extraVolumes` | Additional volumes to the controller pod | `{}`
`controller.ingressClass` | name of the ingress class to route through this controller | `nginx`
`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)
@@ -137,14 +137,22 @@ spec:
timeoutSeconds: {{ .Values.controller.readinessProbe.timeoutSeconds }}
successThreshold: {{ .Values.controller.readinessProbe.successThreshold }}
failureThreshold: {{ .Values.controller.readinessProbe.failureThreshold }}
{{- if .Values.controller.customTemplate.configMapName }}
{{- if (or .Values.controller.customTemplate.configMapName .Values.controller.extraVolumeMounts) }}
volumeMounts:
{{- end }}
{{- if .Values.controller.customTemplate.configMapName }}
- mountPath: /etc/nginx/template
name: nginx-template-volume
readOnly: true
{{- end }}
{{- if .Values.controller.extraVolumeMounts }}
{{ toYaml .Values.controller.extraVolumeMounts | indent 10}}
{{- end }}
resources:
{{ toYaml .Values.controller.resources | indent 12 }}
{{- if .Values.controller.extraContainers }}
{{ toYaml .Values.controller.extraContainers | indent 8}}
{{- end }}
hostNetwork: {{ .Values.controller.hostNetwork }}
{{- if .Values.controller.nodeSelector }}
nodeSelector:
@@ -160,14 +168,19 @@ spec:
{{- end }}
serviceAccountName: {{ if .Values.rbac.create }}{{ template "nginx-ingress.fullname" . }}{{ else }}"{{ .Values.rbac.serviceAccountName }}"{{ end }}
terminationGracePeriodSeconds: 60
{{- if .Values.controller.customTemplate.configMapName }}
{{- if (or .Values.controller.customTemplate.configMapName .Values.controller.extraVolumes) }}
volumes:
{{- end }}
{{- if .Values.controller.customTemplate.configMapName }}
- name: nginx-template-volume
configMap:
name: {{ .Values.controller.customTemplate.configMapName }}
items:
- key: {{ .Values.controller.customTemplate.configMapKey }}
path: nginx.tmpl
{{- end }}
{{- if .Values.controller.extraVolumes }}
{{ toYaml .Values.controller.extraVolumes | indent 6}}
{{- end }}
updateStrategy:
{{ toYaml .Values.controller.updateStrategy | indent 4 }}
@@ -132,14 +132,22 @@ spec:
timeoutSeconds: {{ .Values.controller.readinessProbe.timeoutSeconds }}
successThreshold: {{ .Values.controller.readinessProbe.successThreshold }}
failureThreshold: {{ .Values.controller.readinessProbe.failureThreshold }}
{{- if .Values.controller.customTemplate.configMapName }}
{{- if (or .Values.controller.customTemplate.configMapName .Values.controller.extraVolumeMounts) }}
volumeMounts:
{{- end }}
{{- if .Values.controller.customTemplate.configMapName }}
- mountPath: /etc/nginx/template
name: nginx-template-volume
readOnly: true
{{- end }}
{{- if .Values.controller.extraVolumeMounts }}
{{ toYaml .Values.controller.extraVolumeMounts | indent 10}}
{{- end }}
resources:
{{ toYaml .Values.controller.resources | indent 12 }}
{{- if .Values.controller.extraContainers }}
{{ toYaml .Values.controller.extraContainers | indent 8}}
{{- end }}
hostNetwork: {{ .Values.controller.hostNetwork }}
{{- if .Values.controller.nodeSelector }}
nodeSelector:
@@ -155,8 +163,10 @@ spec:
{{- end }}
serviceAccountName: {{ if .Values.rbac.create }}{{ template "nginx-ingress.fullname" . }}{{ else }}"{{ .Values.rbac.serviceAccountName }}"{{ end }}
terminationGracePeriodSeconds: 60
{{- if .Values.controller.customTemplate.configMapName }}
{{- if (or .Values.controller.customTemplate.configMapName .Values.controller.extraVolumes) }}
volumes:
{{- end }}
{{- if .Values.controller.customTemplate.configMapName }}
- name: nginx-template-volume
configMap:
name: {{ .Values.controller.customTemplate.configMapName }}
@@ -164,4 +174,7 @@ spec:
- key: {{ .Values.controller.customTemplate.configMapKey }}
path: nginx.tmpl
{{- end }}
{{- if .Values.controller.extraVolumes }}
{{ toYaml .Values.controller.extraVolumes | indent 6}}
{{- end }}
{{- end }}
+34
View File
@@ -178,6 +178,40 @@ controller:
http: ""
https: ""
extraContainers: {}
## Additional containers to be added to the controller pod.
## See https://github.com/lemonldap-ng-controller/lemonldap-ng-controller as example.
# - name: my-sidecar
# image: nginx:latest
# - name: lemonldap-ng-controller
# image: lemonldapng/lemonldap-ng-controller:0.2.0
# args:
# - /lemonldap-ng-controller
# - --alsologtostderr
# - --configmap=$(POD_NAMESPACE)/lemonldap-ng-configuration
# env:
# - name: POD_NAME
# valueFrom:
# fieldRef:
# fieldPath: metadata.name
# - name: POD_NAMESPACE
# valueFrom:
# fieldRef:
# fieldPath: metadata.namespace
# volumeMounts:
# - name: copy-portal-skins
# mountPath: /srv/var/lib/lemonldap-ng/portal/skins
extraVolumeMounts: {}
## Additional volumeMounts to the controller main container.
# - name: copy-portal-skins
# mountPath: /var/lib/lemonldap-ng/portal/skins
extraVolumes: {}
## Additional volumes to the controller pod.
# - name: copy-portal-skins
# emptyDir: {}
stats:
enabled: false