Skip to content
This repository was archived by the owner on Feb 22, 2022. It is now read-only.
2 changes: 1 addition & 1 deletion stable/nginx-ingress/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: nginx-ingress
version: 0.9.1
appVersion: 0.10.2
appVersion: 0.10.3
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
3 changes: 3 additions & 0 deletions stable/nginx-ingress/templates/controller-configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ metadata:
name: {{ template "nginx-ingress.controller.fullname" . }}
data:
enable-vts-status: "{{ .Values.controller.stats.enabled }}"
{{- if .Values.dhparamFile }}
ssl-dh-param: '{{ .Release.Namespace }}/{{ template "fullname" . }}-dhparam'
{{ end }}
{{- if .Values.controller.headers }}
proxy-set-headers: {{ .Release.Namespace }}/{{ template "nginx-ingress.fullname" . }}-custom-headers
{{- end }}
Expand Down
21 changes: 21 additions & 0 deletions stable/nginx-ingress/templates/controller-daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@ spec:
metadata:
annotations:
checksum/config: {{ include (print $.Template.BasePath "/controller-configmap.yaml") . | sha256sum }}
{{- if .Values.nginxTemplateFile }}
checksum/custom-template: {{ (print .Values.nginxTemplateFile) . | sha256sum }}
{{- end }}
{{- if .Values.dhparamFile }}
checksum/dhparam: {{ (print .Values.dhparamFile) . | sha256sum }}
{{- end }}
{{- if .Values.controller.podAnnotations }}
{{ toYaml .Values.controller.podAnnotations | indent 8}}
{{- end }}
Expand Down Expand Up @@ -83,6 +89,12 @@ spec:
- name: {{ $key | upper | replace "." "_" }}
value: {{ $value }}
{{- end }}
{{- if or .Values.nginxTemplateFile }}
volumeMounts:
- name: custom-template
mountPath: /etc/nginx/template
readOnly: true
{{- end }}
livenessProbe:
httpGet:
path: /healthz
Expand Down Expand Up @@ -151,6 +163,15 @@ spec:
resources:
{{ toYaml .Values.statsExporter.resources | indent 12 }}
{{- end }}
{{- if or .Values.nginxTemplateFile }}
volumes:
- name: custom-template
configMap:
name: {{ template "fullname" . }}-custom-template
items:
- key: nginx.tmpl
path: nginx.tmpl
{{- end }}
hostNetwork: {{ .Values.controller.hostNetwork }}
{{- if .Values.controller.nodeSelector }}
nodeSelector:
Expand Down
21 changes: 21 additions & 0 deletions stable/nginx-ingress/templates/controller-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,12 @@ spec:
metadata:
annotations:
checksum/config: {{ include (print $.Template.BasePath "/controller-configmap.yaml") . | sha256sum }}
{{- if .Values.nginxTemplateFile }}
checksum/custom-template: {{ (print .Values.nginxTemplateFile) . | sha256sum }}
{{- end }}
{{- if .Values.dhparamFile }}
checksum/dhparam: {{ (print .Values.dhparamFile) . | sha256sum }}
{{- end }}
{{- if .Values.controller.podAnnotations }}
{{ toYaml .Values.controller.podAnnotations | indent 8}}
{{- end }}
Expand Down Expand Up @@ -84,6 +90,12 @@ spec:
- name: {{ $key | upper | replace "." "_" }}
value: {{ $value }}
{{- end }}
{{- if or .Values.nginxTemplateFile }}
volumeMounts:
- name: custom-template
mountPath: /etc/nginx/template
readOnly: true
{{- end }}
livenessProbe:
httpGet:
path: /healthz
Expand Down Expand Up @@ -146,6 +158,15 @@ spec:
resources:
{{ toYaml .Values.statsExporter.resources | indent 12 }}
{{- end }}
{{- if .Values.nginxTemplateFile }}
volumes:
- name: custom-template
configMap:
name: {{ template "fullname" . }}-custom-template
items:
- key: nginx.tmpl
path: nginx.tmpl
{{- end }}
hostNetwork: {{ .Values.controller.hostNetwork }}
{{- if .Values.controller.nodeSelector }}
nodeSelector:
Expand Down
15 changes: 15 additions & 0 deletions stable/nginx-ingress/templates/custom-template-configmap.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{{- if .Values.nginxTemplateFile }}
apiVersion: v1
kind: ConfigMap
metadata:
labels:
app: {{ template "name" . }}
chart: {{ .Chart.Name }}-{{ .Chart.Version }}
component: "{{ .Values.controller.name }}"
heritage: {{ .Release.Service }}
release: {{ .Release.Name }}
name: {{ template "fullname" . }}-custom-template
data:
nginx.tmpl: |-
{{ .Values.nginxTemplateFile | indent 4 }}
{{- end }}
15 changes: 15 additions & 0 deletions stable/nginx-ingress/templates/dhparam-secret.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{{- if .Values.dhparamFile }}
apiVersion: v1
kind: Secret
type: Opaque
metadata:
labels:
app: {{ template "name" . }}
chart: {{ .Chart.Name }}-{{ .Chart.Version }}
component: "{{ .Values.controller.name }}"
heritage: {{ .Release.Service }}
release: {{ .Release.Name }}
name: {{ template "fullname" . }}-dhparam
data:
dhparam.pem: {{ .Values.dhparamFile | b64enc }}
{{- end }}
16 changes: 14 additions & 2 deletions stable/nginx-ingress/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -283,10 +283,22 @@ statsExporter:
# Ref: https://github.com/kubernetes/contrib/tree/master/ingress/controllers/nginx/examples/tcp
##
tcp: {}
# 8080: "default/example-tcp-svc:9000"
# 8080: "default/example-tcp-svc:9000"

# UDP service key:value pairs
# Ref: https://github.com/kubernetes/contrib/tree/master/ingress/controllers/nginx/examples/udp
##
udp: {}
# 53: "kube-system/kube-dns:53"
# 53: "kube-system/kube-dns:53"

## Enables DHParam.
## Provide a file in PEM format
## http://nginx.org/en/docs/http/ngx_http_ssl_module.html#ssl_dhparam
##
# dhparamFile: |-

## Enables Nginx Custom Template.
## Provide template file to use instead of default one
## https://github.com/kubernetes/ingress/blob/master/controllers/nginx/configuration.md#custom-nginx-template
##
# nginxTemplateFile: |-