From b82bf1a6e627d3c9025c1fe583fb193a83cd18c3 Mon Sep 17 00:00:00 2001 From: Brian Harwell Date: Fri, 14 May 2021 13:57:55 -0500 Subject: [PATCH 1/4] Add support for custom probes --- .../templates/controller-daemonset.yaml | 25 ++++------------ .../templates/controller-deployment.yaml | 25 ++++------------ charts/ingress-nginx/values.yaml | 29 +++++++++++++++---- 3 files changed, 33 insertions(+), 46 deletions(-) diff --git a/charts/ingress-nginx/templates/controller-daemonset.yaml b/charts/ingress-nginx/templates/controller-daemonset.yaml index 6989d440c5..0a8ed32145 100644 --- a/charts/ingress-nginx/templates/controller-daemonset.yaml +++ b/charts/ingress-nginx/templates/controller-daemonset.yaml @@ -139,26 +139,11 @@ spec: {{- if .Values.controller.extraEnvs }} {{- toYaml .Values.controller.extraEnvs | nindent 12 }} {{- end }} - livenessProbe: - httpGet: - path: {{ .Values.controller.healthCheckPath }} - port: {{ .Values.controller.livenessProbe.port }} - scheme: HTTP - initialDelaySeconds: {{ .Values.controller.livenessProbe.initialDelaySeconds }} - periodSeconds: {{ .Values.controller.livenessProbe.periodSeconds }} - timeoutSeconds: {{ .Values.controller.livenessProbe.timeoutSeconds }} - successThreshold: {{ .Values.controller.livenessProbe.successThreshold }} - failureThreshold: {{ .Values.controller.livenessProbe.failureThreshold }} - readinessProbe: - httpGet: - path: {{ .Values.controller.healthCheckPath }} - port: {{ .Values.controller.readinessProbe.port }} - scheme: HTTP - initialDelaySeconds: {{ .Values.controller.readinessProbe.initialDelaySeconds }} - periodSeconds: {{ .Values.controller.readinessProbe.periodSeconds }} - timeoutSeconds: {{ .Values.controller.readinessProbe.timeoutSeconds }} - successThreshold: {{ .Values.controller.readinessProbe.successThreshold }} - failureThreshold: {{ .Values.controller.readinessProbe.failureThreshold }} + {{- if .Values.controller.startupProbe }} + startupProbe: {{ toYaml .Values.controller.startupProbe | nindent 12 }} + {{- end }} + livenessProbe: {{ toYaml .Values.controller.livenessProbe | nindent 12 }} + readinessProbe: {{ toYaml .Values.controller.readinessProbe | nindent 12 }} ports: {{- range $key, $value := .Values.controller.containerPort }} - name: {{ $key }} diff --git a/charts/ingress-nginx/templates/controller-deployment.yaml b/charts/ingress-nginx/templates/controller-deployment.yaml index 332407e42c..d1ed71f9a0 100644 --- a/charts/ingress-nginx/templates/controller-deployment.yaml +++ b/charts/ingress-nginx/templates/controller-deployment.yaml @@ -139,27 +139,12 @@ spec: {{- end }} {{- if .Values.controller.extraEnvs }} {{- toYaml .Values.controller.extraEnvs | nindent 12 }} + {{- end }} + {{- if .Values.controller.startupProbe }} + startupProbe: {{ toYaml .Values.controller.startupProbe | nindent 12 }} {{- end }} - livenessProbe: - httpGet: - path: {{ .Values.controller.healthCheckPath }} - port: {{ .Values.controller.livenessProbe.port }} - scheme: HTTP - initialDelaySeconds: {{ .Values.controller.livenessProbe.initialDelaySeconds }} - periodSeconds: {{ .Values.controller.livenessProbe.periodSeconds }} - timeoutSeconds: {{ .Values.controller.livenessProbe.timeoutSeconds }} - successThreshold: {{ .Values.controller.livenessProbe.successThreshold }} - failureThreshold: {{ .Values.controller.livenessProbe.failureThreshold }} - readinessProbe: - httpGet: - path: {{ .Values.controller.healthCheckPath }} - port: {{ .Values.controller.readinessProbe.port }} - scheme: HTTP - initialDelaySeconds: {{ .Values.controller.readinessProbe.initialDelaySeconds }} - periodSeconds: {{ .Values.controller.readinessProbe.periodSeconds }} - timeoutSeconds: {{ .Values.controller.readinessProbe.timeoutSeconds }} - successThreshold: {{ .Values.controller.readinessProbe.successThreshold }} - failureThreshold: {{ .Values.controller.readinessProbe.failureThreshold }} + livenessProbe: {{ toYaml .Values.controller.livenessProbe | nindent 12 }} + readinessProbe: {{ toYaml .Values.controller.readinessProbe | nindent 12 }} ports: {{- range $key, $value := .Values.controller.containerPort }} - name: {{ $key }} diff --git a/charts/ingress-nginx/values.yaml b/charts/ingress-nginx/values.yaml index 0a02d60bc3..534d5a2418 100644 --- a/charts/ingress-nginx/values.yaml +++ b/charts/ingress-nginx/values.yaml @@ -251,20 +251,37 @@ controller: ## Liveness and readiness probe values ## Ref: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#container-probes ## + # startupProbe: + # httpGet: + # path: "/healthz" # should match container.healthCheckPath + # port: 10254 + # scheme: HTTP + # initialDelaySeconds: 5 + # periodSeconds: 5 + # timeoutSeconds: 2 + # successThreshold: 1 + # failureThreshold: 5 livenessProbe: - failureThreshold: 5 + httpGet: + path: "/healthz" # should match container.healthCheckPath + port: 10254 + scheme: HTTP initialDelaySeconds: 10 periodSeconds: 10 - successThreshold: 1 timeoutSeconds: 1 - port: 10254 + successThreshold: 1 + failureThreshold: 5 readinessProbe: - failureThreshold: 3 + httpGet: + path: "/healthz" # should match container.healthCheckPath + port: 10254 + scheme: HTTP initialDelaySeconds: 10 periodSeconds: 10 - successThreshold: 1 timeoutSeconds: 1 - port: 10254 + successThreshold: 1 + failureThreshold: 3 + # Path of the health check endpoint. All requests received on the port defined by # the healthz-port parameter are forwarded internally to this path. From 32d66d14ff6dbfb4b631952ade4ea26b96181d6e Mon Sep 17 00:00:00 2001 From: Brian Harwell Date: Tue, 18 May 2021 07:49:17 -0500 Subject: [PATCH 2/4] Fix lint issue with comment --- charts/ingress-nginx/values.yaml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/charts/ingress-nginx/values.yaml b/charts/ingress-nginx/values.yaml index 534d5a2418..465bd45f0e 100644 --- a/charts/ingress-nginx/values.yaml +++ b/charts/ingress-nginx/values.yaml @@ -253,7 +253,8 @@ controller: ## # startupProbe: # httpGet: - # path: "/healthz" # should match container.healthCheckPath + # # should match container.healthCheckPath + # path: "/healthz" # port: 10254 # scheme: HTTP # initialDelaySeconds: 5 @@ -263,7 +264,8 @@ controller: # failureThreshold: 5 livenessProbe: httpGet: - path: "/healthz" # should match container.healthCheckPath + # should match container.healthCheckPath + path: "/healthz" port: 10254 scheme: HTTP initialDelaySeconds: 10 @@ -273,7 +275,8 @@ controller: failureThreshold: 5 readinessProbe: httpGet: - path: "/healthz" # should match container.healthCheckPath + # should match container.healthCheckPath + path: "/healthz" port: 10254 scheme: HTTP initialDelaySeconds: 10 From 3f55876fb844fc77ad2022e52785a09b963a5944 Mon Sep 17 00:00:00 2001 From: Brian Harwell Date: Tue, 18 May 2021 07:49:29 -0500 Subject: [PATCH 3/4] Bump chart version --- charts/ingress-nginx/Chart.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/ingress-nginx/Chart.yaml b/charts/ingress-nginx/Chart.yaml index b35e4968f1..15875f0831 100644 --- a/charts/ingress-nginx/Chart.yaml +++ b/charts/ingress-nginx/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v2 name: ingress-nginx # When the version is modified, make sure the artifacthub.io/changes list is updated # Also update CHANGELOG.md -version: 3.30.0 +version: 3.31.0 appVersion: 0.46.0 home: https://github.com/kubernetes/ingress-nginx description: Ingress controller for Kubernetes using NGINX as a reverse proxy and load balancer From 13240b871e90b7edbe4c88566179a7a43113c886 Mon Sep 17 00:00:00 2001 From: Brian Harwell Date: Tue, 18 May 2021 07:51:59 -0500 Subject: [PATCH 4/4] Fix lint issue --- charts/ingress-nginx/values.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/ingress-nginx/values.yaml b/charts/ingress-nginx/values.yaml index 465bd45f0e..cd1f907608 100644 --- a/charts/ingress-nginx/values.yaml +++ b/charts/ingress-nginx/values.yaml @@ -265,7 +265,7 @@ controller: livenessProbe: httpGet: # should match container.healthCheckPath - path: "/healthz" + path: "/healthz" port: 10254 scheme: HTTP initialDelaySeconds: 10