From bd3306342b1875248e38538824402729ff55a7e6 Mon Sep 17 00:00:00 2001 From: Ciaran McKay Date: Tue, 10 May 2022 08:52:19 +0100 Subject: [PATCH 1/3] Add minReadySeconds & strategy support --- deployments/helm-chart/README.md | 2 ++ .../helm-chart/templates/controller-deployment.yaml | 7 +++++++ 2 files changed, 9 insertions(+) diff --git a/deployments/helm-chart/README.md b/deployments/helm-chart/README.md index e161ba7448..01b72993d6 100644 --- a/deployments/helm-chart/README.md +++ b/deployments/helm-chart/README.md @@ -232,6 +232,8 @@ Parameter | Description | Default `controller.readyStatus.enable` | Enables the readiness endpoint `"/nginx-ready"`. The endpoint returns a success code when NGINX has loaded all the config after the startup. This also configures a readiness probe for the Ingress Controller pods that uses the readiness endpoint. | true `controller.readyStatus.port` | The HTTP port for the readiness endpoint. | 8081 `controller.enableLatencyMetrics` | Enable collection of latency metrics for upstreams. Requires `prometheus.create`. | false +`controller.minReadySeconds` | Specifies the minimum number of seconds for which a newly created Pod should be ready without any of its containers crashing, for it to be considered available. [docs](https://kubernetes.io/docs/concepts/workloads/controllers/deployment/#min-ready-seconds) | 0 +`controller.strategy` | Specifies the strategy used to replace old Pods by new ones. [docs](https://kubernetes.io/docs/concepts/workloads/controllers/deployment/#strategy) | {} `rbac.create` | Configures RBAC. | true `prometheus.create` | Expose NGINX or NGINX Plus metrics in the Prometheus format. | false `prometheus.port` | Configures the port to scrape the metrics. | 9113 diff --git a/deployments/helm-chart/templates/controller-deployment.yaml b/deployments/helm-chart/templates/controller-deployment.yaml index 0816279dba..07a3f2297a 100644 --- a/deployments/helm-chart/templates/controller-deployment.yaml +++ b/deployments/helm-chart/templates/controller-deployment.yaml @@ -207,3 +207,10 @@ spec: initContainers: {{ toYaml .Values.controller.initContainers | nindent 8 }} {{- end }} {{- end }} +{{- if .Values.controller.strategy }} + strategy: +{{ toYaml .Values.controller.strategy | indent 4 }} +{{- end }} +{{- if .Values.controller.minReadySeconds }} + minReadySeconds: {{ .Values.controller.minReadySeconds }} +{{- end }} From 055c8999edbf6d8634b8c2766ef3dd88e37aebd6 Mon Sep 17 00:00:00 2001 From: Ciaran McKay Date: Fri, 13 May 2022 07:50:30 +0100 Subject: [PATCH 2/3] Add params to daemonset and default values --- deployments/helm-chart/templates/controller-daemonset.yaml | 7 +++++++ deployments/helm-chart/values.yaml | 6 ++++++ 2 files changed, 13 insertions(+) diff --git a/deployments/helm-chart/templates/controller-daemonset.yaml b/deployments/helm-chart/templates/controller-daemonset.yaml index c31267c986..4bc4d3a546 100644 --- a/deployments/helm-chart/templates/controller-daemonset.yaml +++ b/deployments/helm-chart/templates/controller-daemonset.yaml @@ -208,3 +208,10 @@ spec: initContainers: {{ toYaml .Values.controller.initContainers | nindent 8 }} {{- end }} {{- end }} +{{- if .Values.controller.strategy }} + strategy: +{{ toYaml .Values.controller.strategy | indent 4 }} +{{- end }} +{{- if .Values.controller.minReadySeconds }} + minReadySeconds: {{ .Values.controller.minReadySeconds }} +{{- end }} diff --git a/deployments/helm-chart/values.yaml b/deployments/helm-chart/values.yaml index bf857d22b5..2a1469c239 100644 --- a/deployments/helm-chart/values.yaml +++ b/deployments/helm-chart/values.yaml @@ -136,6 +136,12 @@ controller: # image: busybox:1.34 # command: ['sh', '-c', 'echo this is initial setup!'] + ## The minimum number of seconds for which a newly created Pod should be ready without any of its containers crashing, for it to be considered available. + minReadySeconds: 0 + + ## Strategy used to replace old Pods by new ones. .spec.strategy.type can be "Recreate" or "RollingUpdate". "RollingUpdate" is the default value. + strategy: {} + ## Extra containers for the Ingress Controller pods. extraContainers: [] # - name: container From 8c9ce50b4d5fdd4c76ff4d990bd419d70729903a Mon Sep 17 00:00:00 2001 From: Ciaran <59477805+cmk-pcs@users.noreply.github.com> Date: Tue, 17 May 2022 07:37:20 +0100 Subject: [PATCH 3/3] Fix daemonset strategy label Co-authored-by: Luca Comellini --- deployments/helm-chart/templates/controller-daemonset.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deployments/helm-chart/templates/controller-daemonset.yaml b/deployments/helm-chart/templates/controller-daemonset.yaml index 4bc4d3a546..17fecb6d43 100644 --- a/deployments/helm-chart/templates/controller-daemonset.yaml +++ b/deployments/helm-chart/templates/controller-daemonset.yaml @@ -209,7 +209,7 @@ spec: {{- end }} {{- end }} {{- if .Values.controller.strategy }} - strategy: + updateStrategy: {{ toYaml .Values.controller.strategy | indent 4 }} {{- end }} {{- if .Values.controller.minReadySeconds }}