From 3a5bc90709856074deff9aea32d33ac6523d6e8d Mon Sep 17 00:00:00 2001 From: Manuel Alejandro de Brito Fontes Date: Sun, 15 Mar 2020 11:54:58 -0300 Subject: [PATCH] Add support for custom healthz path in helm chart --- charts/ingress-nginx/README.md | 1 + charts/ingress-nginx/templates/controller-daemonset.yaml | 3 +++ charts/ingress-nginx/templates/controller-deployment.yaml | 7 +++++-- charts/ingress-nginx/values.yaml | 4 ++++ 4 files changed, 13 insertions(+), 2 deletions(-) diff --git a/charts/ingress-nginx/README.md b/charts/ingress-nginx/README.md index 4a3bbbd48e..9ee9f34a90 100644 --- a/charts/ingress-nginx/README.md +++ b/charts/ingress-nginx/README.md @@ -69,6 +69,7 @@ Parameter | Description | Default `controller.extraVolumeMounts` | Additional volumeMounts to the controller main container | `{}` `controller.extraVolumes` | Additional volumes to the controller pod | `{}` `controller.extraInitContainers` | Containers, which are run before the app containers are started | `[]` +`controller.healthCheckPath` | Path of the health check endpoint. All requests received on the port defined by the healthz-port parameter are forwarded internally to this path. | `/healthz"` `controller.ingressClass` | name of the ingress class to route through this controller | `nginx` `controller.maxmindLicenseKey` | Maxmind license key to download GeoLite2 Databases. See [Accessing and using GeoLite2 database](https://blog.maxmind.com/2019/12/18/significant-changes-to-accessing-and-using-geolite2-databases/) | `""` `controller.scope.enabled` | limit the scope of the ingress controller | `false` (watch all namespaces) diff --git a/charts/ingress-nginx/templates/controller-daemonset.yaml b/charts/ingress-nginx/templates/controller-daemonset.yaml index 6decaf7009..fc7def9d6c 100644 --- a/charts/ingress-nginx/templates/controller-daemonset.yaml +++ b/charts/ingress-nginx/templates/controller-daemonset.yaml @@ -82,6 +82,9 @@ spec: {{- if .Values.controller.maxmindLicenseKey }} - --maxmind-license-key={{ .Values.controller.maxmindLicenseKey }} {{- end }} + {{- if not (eq .Values.controller.healthCheckPath "/healthz") }} + - --health-check-path={{ .Values.controller.healthCheckPath }} + {{- end }} {{- range $key, $value := .Values.controller.extraArgs }} {{- if $value }} - --{{ $key }}={{ $value }} diff --git a/charts/ingress-nginx/templates/controller-deployment.yaml b/charts/ingress-nginx/templates/controller-deployment.yaml index 742251afc2..0eefac0baf 100644 --- a/charts/ingress-nginx/templates/controller-deployment.yaml +++ b/charts/ingress-nginx/templates/controller-deployment.yaml @@ -85,6 +85,9 @@ spec: {{- if .Values.controller.maxmindLicenseKey }} - --maxmind-license-key={{ .Values.controller.maxmindLicenseKey }} {{- end }} + {{- if not (eq .Values.controller.healthCheckPath "/healthz") }} + - --health-check-path={{ .Values.controller.healthCheckPath }} + {{- end }} {{- range $key, $value := .Values.controller.extraArgs }} {{- if $value }} - --{{ $key }}={{ $value }} @@ -114,7 +117,7 @@ spec: {{- end }} livenessProbe: httpGet: - path: /healthz + path: {{ .Values.controller.healthCheckPath }} port: {{ .Values.controller.livenessProbe.port }} scheme: HTTP initialDelaySeconds: {{ .Values.controller.livenessProbe.initialDelaySeconds }} @@ -124,7 +127,7 @@ spec: failureThreshold: {{ .Values.controller.livenessProbe.failureThreshold }} readinessProbe: httpGet: - path: /healthz + path: {{ .Values.controller.healthCheckPath }} port: {{ .Values.controller.readinessProbe.port }} scheme: HTTP initialDelaySeconds: {{ .Values.controller.readinessProbe.initialDelaySeconds }} diff --git a/charts/ingress-nginx/values.yaml b/charts/ingress-nginx/values.yaml index 30d9646e75..7535c80ef7 100644 --- a/charts/ingress-nginx/values.yaml +++ b/charts/ingress-nginx/values.yaml @@ -212,6 +212,10 @@ controller: timeoutSeconds: 1 port: 10254 + # Path of the health check endpoint. All requests received on the port defined by + # the healthz-port parameter are forwarded internally to this path. + healthCheckPath: "/healthz" + ## Annotations to be added to controller pods ## podAnnotations: {}