From fb218484d0986fa392060e5f0f3ab1ea074acae4 Mon Sep 17 00:00:00 2001 From: Markus Pesch Date: Sun, 19 Jan 2025 21:45:16 +0100 Subject: [PATCH] fix(deployment): add missing rolling release strategy --- README.md | 2 +- templates/prometheus-postgres-exporter/deployment.yaml | 4 ++++ unittests/deployment/deployment.yaml | 7 +++++++ values.yaml | 2 +- 4 files changed, 13 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 0b96e29..f5a737f 100644 --- a/README.md +++ b/README.md @@ -248,7 +248,7 @@ deployment: | `deployment.replicas` | Number of replicas for the postgres-exporter deployment. | `1` | | `deployment.restartPolicy` | Restart policy of the postgres-exporter deployment. | `""` | | `deployment.securityContext` | Security context of the postgres-exporter deployment. | `{}` | -| `deployment.strategy.type` | Strategy type - `Recreate` or `Rollingupdate`. | `Recreate` | +| `deployment.strategy.type` | Strategy type - `Recreate` or `Rollingupdate`. | `Rollingupdate` | | `deployment.strategy.rollingUpdate.maxSurge` | The maximum number of pods that can be scheduled above the desired number of pods during a rolling update. | `1` | | `deployment.strategy.rollingUpdate.maxUnavailable` | The maximum number of pods that can be unavailable during a rolling update. | `1` | | `deployment.terminationGracePeriodSeconds` | How long to wait until forcefully kill the pod. | `60` | diff --git a/templates/prometheus-postgres-exporter/deployment.yaml b/templates/prometheus-postgres-exporter/deployment.yaml index a09b462..5b08c92 100644 --- a/templates/prometheus-postgres-exporter/deployment.yaml +++ b/templates/prometheus-postgres-exporter/deployment.yaml @@ -126,3 +126,7 @@ spec: volumes: {{- toYaml $volumes.volumes | nindent 6 }} {{- end }} + {{- with .Values.deployment.strategy }} + strategy: + {{- toYaml . | nindent 4 }} + {{- end }} \ No newline at end of file diff --git a/unittests/deployment/deployment.yaml b/unittests/deployment/deployment.yaml index e92dfd1..7796bb6 100644 --- a/unittests/deployment/deployment.yaml +++ b/unittests/deployment/deployment.yaml @@ -95,6 +95,13 @@ tests: path: spec.template.spec.tolerations - notExists: path: spec.template.spec.topologySpreadConstraints + - equal: + path: spec.strategy + value: + type: "Rollingupdate" + rollingUpdate: + maxSurge: 1 + maxUnavailable: 1 - it: Test custom replicas set: diff --git a/values.yaml b/values.yaml index 7ca1dd6..49de4d0 100644 --- a/values.yaml +++ b/values.yaml @@ -228,7 +228,7 @@ deployment: ## @param deployment.strategy.rollingUpdate.maxSurge The maximum number of pods that can be scheduled above the desired number of pods during a rolling update. ## @param deployment.strategy.rollingUpdate.maxUnavailable The maximum number of pods that can be unavailable during a rolling update. strategy: - type: "Recreate" + type: "Rollingupdate" rollingUpdate: maxSurge: 1 maxUnavailable: 1