diff --git a/charts/ingress-nginx/templates/_params.tpl b/charts/ingress-nginx/templates/_params.tpl index a1aef01ae..28cb7114d 100644 --- a/charts/ingress-nginx/templates/_params.tpl +++ b/charts/ingress-nginx/templates/_params.tpl @@ -39,6 +39,9 @@ {{- if .Values.controller.maxmindLicenseKey }} - --maxmind-license-key={{ .Values.controller.maxmindLicenseKey }} {{- end }} +{{- if .Values.controller.maxmindLicenseKeySecret }} +- --maxmind-license-key-file={{ .Values.controller.maxmindLicenseKeySecretVolumeMountPath }}/{{ .Values.controller.maxmindLicenseKeyFilename }} +{{- end }} {{- if .Values.controller.healthCheckHost }} - --healthz-host={{ .Values.controller.healthCheckHost }} {{- end }} diff --git a/charts/ingress-nginx/templates/controller-deployment.yaml b/charts/ingress-nginx/templates/controller-deployment.yaml index 9f1cf70db..450e73c43 100644 --- a/charts/ingress-nginx/templates/controller-deployment.yaml +++ b/charts/ingress-nginx/templates/controller-deployment.yaml @@ -167,6 +167,11 @@ spec: mountPath: /usr/local/certificates/ readOnly: true {{- end }} + {{- if .Values.controller.maxmindLicenseKeySecret }} + - name: maxmind-license-key + mountPath: {{ .Values.controller.maxmindLicenseKeySecretVolumeMountPath }} + readOnly: true + {{- end }} {{- if .Values.controller.extraVolumeMounts }} {{- toYaml .Values.controller.extraVolumeMounts | nindent 12 }} {{- end }} @@ -236,6 +241,14 @@ spec: path: key {{- end }} {{- end }} + {{- if .Values.controller.maxmindLicenseKeySecret }} + - name: maxmind-license-key + secret: + secretName: {{ .Values.controller.maxmindLicenseKeySecret }} + items: + - key: {{ .Values.controller.maxmindLicenseKeyFilename }} + path: {{ .Values.controller.maxmindLicenseKeyFilename }} + {{- end }} {{- if .Values.controller.extraVolumes }} {{ toYaml .Values.controller.extraVolumes | nindent 8 }} {{- end }} diff --git a/charts/ingress-nginx/values.yaml b/charts/ingress-nginx/values.yaml index 202cd4a23..15ab53fba 100644 --- a/charts/ingress-nginx/values.yaml +++ b/charts/ingress-nginx/values.yaml @@ -150,6 +150,12 @@ controller: # -- Maxmind license key to download GeoLite2 Databases. ## https://blog.maxmind.com/2019/12/18/significant-changes-to-accessing-and-using-geolite2-databases maxmindLicenseKey: "" + # -- Alternatively provide the name of a secret to get the Maxmind license key from + maxmindLicenseKeySecret: "" + # -- Customize the location to mount the Maxmind license key secret + maxmindLicenseKeySecretVolumeMountPath: "/etc/maxmind" + # -- Customize the filename for the Maxmind license key secret + maxmindLicenseKeyFilename: "license_key" # -- Additional command line arguments to pass to nginx-ingress-controller # E.g. to specify the default SSL certificate you can use extraArgs: {}