From 34fc2dfad665712bf379c84150f4b93cdbcea0f4 Mon Sep 17 00:00:00 2001 From: Jesse Hitch Date: Wed, 24 Jul 2024 08:39:00 +0200 Subject: [PATCH] only set spec.replicas in Nextcloud deployment if .Values.hpa.enabled is set to false (#596) update hpa ci test to use a minimum of 2 pods Signed-off-by: jessebot Co-authored-by: Kate <26026535+provokateurin@users.noreply.github.com> --- .github/workflows/lint-test.yaml | 2 +- charts/nextcloud/Chart.yaml | 2 +- charts/nextcloud/README.md | 2 +- charts/nextcloud/templates/deployment.yaml | 2 ++ 4 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/lint-test.yaml b/.github/workflows/lint-test.yaml index d7b760fc..a6205de0 100644 --- a/.github/workflows/lint-test.yaml +++ b/.github/workflows/lint-test.yaml @@ -80,7 +80,7 @@ jobs: # test the helm chart with horizontal pod autoscaling enabled - name: Horizontal Pod Autoscaling Enabled - helm_args: '--helm-extra-set-args "--set=hpa.enabled=true --set=hpa.minPods=1 --set=hpa.maxPods=3 --set=hpa.targetCPUUtilizationPercentage=75"' + helm_args: '--helm-extra-set-args "--set=hpa.enabled=true --set=hpa.minPods=2 --set=hpa.maxPods=3 --set=hpa.targetCPUUtilizationPercentage=75"' steps: - name: Checkout diff --git a/charts/nextcloud/Chart.yaml b/charts/nextcloud/Chart.yaml index a729d32c..c39f46ac 100644 --- a/charts/nextcloud/Chart.yaml +++ b/charts/nextcloud/Chart.yaml @@ -1,6 +1,6 @@ apiVersion: v2 name: nextcloud -version: 5.3.0 +version: 5.3.1 appVersion: 29.0.4 description: A file sharing server that puts the control and security of your own data back into your hands. keywords: diff --git a/charts/nextcloud/README.md b/charts/nextcloud/README.md index 8f8cbfaa..d50338d5 100644 --- a/charts/nextcloud/README.md +++ b/charts/nextcloud/README.md @@ -203,7 +203,7 @@ The following table lists the configurable parameters of the nextcloud chart and | `startupProbe.timeoutSeconds` | When the probe times out | `5` | | `startupProbe.failureThreshold` | Minimum consecutive failures for the probe | `30` | | `startupProbe.successThreshold` | Minimum consecutive successes for the probe | `1` | -| `hpa.enabled` | Boolean to create a HorizontalPodAutoscaler | `false` | +| `hpa.enabled` | Boolean to create a HorizontalPodAutoscaler. If set to `true`, ignores `replicaCount`. | `false` | | `hpa.cputhreshold` | CPU threshold percent for the HorizontalPodAutoscale | `60` | | `hpa.minPods` | Min. pods for the Nextcloud HorizontalPodAutoscaler | `1` | | `hpa.maxPods` | Max. pods for the Nextcloud HorizontalPodAutoscaler | `10` | diff --git a/charts/nextcloud/templates/deployment.yaml b/charts/nextcloud/templates/deployment.yaml index db73a64d..6f601963 100644 --- a/charts/nextcloud/templates/deployment.yaml +++ b/charts/nextcloud/templates/deployment.yaml @@ -17,7 +17,9 @@ metadata: {{- toYaml . | nindent 4 }} {{- end }} spec: + {{- if not .Values.hpa.enabled }} replicas: {{ .Values.replicaCount }} + {{- end }} strategy: {{- toYaml .Values.nextcloud.strategy | nindent 4 }} selector: