From e33548d8167a2c47b57bcea4eaba2cb3155f455c Mon Sep 17 00:00:00 2001 From: Henri Philipps Date: Thu, 5 May 2022 17:43:53 +0200 Subject: [PATCH 01/13] switch to autoscaling/v2beta2 API everywhere --- charts/gitlab/charts/gitlab-pages/templates/hpa.yaml | 6 ++++-- charts/gitlab/charts/gitlab-shell/templates/hpa.yaml | 6 ++++-- charts/gitlab/charts/kas/templates/hpa.yaml | 6 ++++-- charts/gitlab/charts/mailroom/templates/hpa.yaml | 6 ++++-- charts/gitlab/charts/mailroom/values.yaml | 2 +- charts/gitlab/charts/sidekiq/templates/hpa.yaml | 6 ++++-- charts/gitlab/charts/spamcheck/templates/hpa.yaml | 8 +++++--- charts/gitlab/charts/webservice/templates/hpa.yaml | 6 ++++-- .../nginx-ingress/templates/default-backend-hpa.yaml | 10 +++++++--- charts/registry/templates/hpa.yaml | 6 ++++-- charts/registry/values.yaml | 2 +- doc/charts/gitlab/mailroom/index.md | 4 ++-- doc/charts/registry/index.md | 2 +- 13 files changed, 45 insertions(+), 25 deletions(-) diff --git a/charts/gitlab/charts/gitlab-pages/templates/hpa.yaml b/charts/gitlab/charts/gitlab-pages/templates/hpa.yaml index 67b65390f2..340bfe8b40 100644 --- a/charts/gitlab/charts/gitlab-pages/templates/hpa.yaml +++ b/charts/gitlab/charts/gitlab-pages/templates/hpa.yaml @@ -1,4 +1,4 @@ -apiVersion: autoscaling/v2beta1 +apiVersion: autoscaling/v2beta2 kind: HorizontalPodAutoscaler metadata: name: {{ template "fullname" . }} @@ -18,7 +18,9 @@ spec: - type: Resource resource: name: cpu - targetAverageValue: {{ .Values.hpa.targetAverageValue }} + target: + type: AverageValue + averageValue: {{ .Values.hpa.targetAverageValue }} {{- else -}} {{- toYaml .Values.hpa.customMetrics | nindent 4 -}} {{- end -}} diff --git a/charts/gitlab/charts/gitlab-shell/templates/hpa.yaml b/charts/gitlab/charts/gitlab-shell/templates/hpa.yaml index 291471486c..ad870ba173 100644 --- a/charts/gitlab/charts/gitlab-shell/templates/hpa.yaml +++ b/charts/gitlab/charts/gitlab-shell/templates/hpa.yaml @@ -1,5 +1,5 @@ {{- if .Values.enabled -}} -apiVersion: autoscaling/v2beta1 +apiVersion: autoscaling/v2beta2 kind: HorizontalPodAutoscaler metadata: name: {{ template "fullname" . }} @@ -18,5 +18,7 @@ spec: - type: Resource resource: name: cpu - targetAverageValue: {{ .Values.hpa.targetAverageValue }} + target: + type: AverageValue + averageValue: {{ .Values.hpa.targetAverageValue }} {{- end -}} diff --git a/charts/gitlab/charts/kas/templates/hpa.yaml b/charts/gitlab/charts/kas/templates/hpa.yaml index 7318eecc40..1890c7cd2e 100644 --- a/charts/gitlab/charts/kas/templates/hpa.yaml +++ b/charts/gitlab/charts/kas/templates/hpa.yaml @@ -1,5 +1,5 @@ {{- if .Values.global.kas.enabled -}} -apiVersion: autoscaling/v2beta1 +apiVersion: autoscaling/v2beta2 kind: HorizontalPodAutoscaler metadata: name: {{ template "fullname" . }} @@ -18,5 +18,7 @@ spec: - type: Resource resource: name: cpu - targetAverageValue: {{ .Values.hpa.targetAverageValue }} + target: + type: AverageValue + averageValue: {{ .Values.hpa.targetAverageValue }} {{- end -}} diff --git a/charts/gitlab/charts/mailroom/templates/hpa.yaml b/charts/gitlab/charts/mailroom/templates/hpa.yaml index 50e9bd835b..18312da9cc 100644 --- a/charts/gitlab/charts/mailroom/templates/hpa.yaml +++ b/charts/gitlab/charts/mailroom/templates/hpa.yaml @@ -1,5 +1,5 @@ {{- if and .Values.enabled .Values.global.appConfig.incomingEmail.enabled }} -apiVersion: autoscaling/v2beta1 +apiVersion: autoscaling/v2beta2 kind: HorizontalPodAutoscaler metadata: name: {{ template "fullname" . }} @@ -19,7 +19,9 @@ spec: - type: Resource resource: name: cpu - targetAverageUtilization: {{ .Values.hpa.cpu.targetAverageUtilization }} + target: + type: Utilization + averageUtilization: {{ .Values.hpa.cpu.targetAverageUtilization }} {{- else -}} {{- toYaml .Values.hpa.customMetrics | nindent 4 -}} {{- end -}} diff --git a/charts/gitlab/charts/mailroom/values.yaml b/charts/gitlab/charts/mailroom/values.yaml index d898c41ffc..37fff9c7aa 100644 --- a/charts/gitlab/charts/mailroom/values.yaml +++ b/charts/gitlab/charts/mailroom/values.yaml @@ -88,7 +88,7 @@ hpa: cpu: targetAverageUtilization: 75 - # Note that the HPA is limited to autoscaling/v2beta1 + # Note that the HPA is limited to autoscaling/v2beta2 customMetrics: [] # Mailroom does not require inbound connections diff --git a/charts/gitlab/charts/sidekiq/templates/hpa.yaml b/charts/gitlab/charts/sidekiq/templates/hpa.yaml index 930c713b75..26c72905a0 100644 --- a/charts/gitlab/charts/sidekiq/templates/hpa.yaml +++ b/charts/gitlab/charts/sidekiq/templates/hpa.yaml @@ -7,7 +7,7 @@ {{- $hpa := default dict .hpa }} {{- include "sidekiq.pod.common.labels" . }} --- -apiVersion: autoscaling/v2beta1 +apiVersion: autoscaling/v2beta2 kind: HorizontalPodAutoscaler metadata: name: {{ printf "%s-v2" ($queueName | trunc 60) }} @@ -26,6 +26,8 @@ spec: - type: Resource resource: name: cpu - targetAverageValue: {{ default $.Values.hpa.targetAverageValue $hpa.targetAverageValue }} + target: + type: AverageValue + averageValue: {{ default $.Values.hpa.targetAverageValue $hpa.targetAverageValue }} {{- end }} {{- end -}} diff --git a/charts/gitlab/charts/spamcheck/templates/hpa.yaml b/charts/gitlab/charts/spamcheck/templates/hpa.yaml index 58c9fcf6ff..00b28accc8 100644 --- a/charts/gitlab/charts/spamcheck/templates/hpa.yaml +++ b/charts/gitlab/charts/spamcheck/templates/hpa.yaml @@ -1,5 +1,5 @@ {{- if .Values.global.spamcheck.enabled -}} -apiVersion: autoscaling/v2beta1 +apiVersion: autoscaling/v2beta2 kind: HorizontalPodAutoscaler metadata: name: {{ template "fullname" . }} @@ -19,8 +19,10 @@ spec: - type: Resource resource: name: cpu - targetAverageValue: {{ .Values.hpa.targetAverageValue }} + target: + type: AverageValue + averageValue: {{ .Values.hpa.targetAverageValue }} {{- else -}} {{- toYaml .Values.hpa.customMetrics | nindent 4 -}} {{- end -}} -{{- end }} \ No newline at end of file +{{- end }} diff --git a/charts/gitlab/charts/webservice/templates/hpa.yaml b/charts/gitlab/charts/webservice/templates/hpa.yaml index 7a33b6bad3..46398ccd5e 100644 --- a/charts/gitlab/charts/webservice/templates/hpa.yaml +++ b/charts/gitlab/charts/webservice/templates/hpa.yaml @@ -8,7 +8,7 @@ From here on: - `.name` is the key (xyz) */}} --- -apiVersion: autoscaling/v2beta1 +apiVersion: autoscaling/v2beta2 kind: HorizontalPodAutoscaler metadata: name: {{ template "webservice.fullname.withSuffix" . }} @@ -29,7 +29,9 @@ spec: - type: Resource resource: name: cpu - targetAverageValue: {{ .hpa.targetAverageValue }} + target: + type: AverageValue + averageValue: {{ .hpa.targetAverageValue }} {{- else }} {{- toYaml .hpa.customMetrics | nindent 4 -}} {{- end }} diff --git a/charts/nginx-ingress/templates/default-backend-hpa.yaml b/charts/nginx-ingress/templates/default-backend-hpa.yaml index bcab496399..035d3a2f32 100644 --- a/charts/nginx-ingress/templates/default-backend-hpa.yaml +++ b/charts/nginx-ingress/templates/default-backend-hpa.yaml @@ -1,5 +1,5 @@ {{- if and .Values.defaultBackend.enabled .Values.defaultBackend.autoscaling.enabled }} -apiVersion: autoscaling/v2beta1 +apiVersion: autoscaling/v2beta2 kind: HorizontalPodAutoscaler metadata: labels: @@ -22,12 +22,16 @@ spec: - type: Resource resource: name: cpu - targetAverageUtilization: {{ . }} + target: + type: Utilization + averageUtilization: {{ . }} {{- end }} {{- with .Values.defaultBackend.autoscaling.targetMemoryUtilizationPercentage }} - type: Resource resource: name: memory - targetAverageUtilization: {{ . }} + target: + type: Utilization + averageUtilization: {{ . }} {{- end }} {{- end }} diff --git a/charts/registry/templates/hpa.yaml b/charts/registry/templates/hpa.yaml index 5464c0ef8d..6df3e5fc3e 100644 --- a/charts/registry/templates/hpa.yaml +++ b/charts/registry/templates/hpa.yaml @@ -1,5 +1,5 @@ {{- if .Values.enabled -}} -apiVersion: autoscaling/v2beta1 +apiVersion: autoscaling/v2beta2 kind: HorizontalPodAutoscaler metadata: name: {{ template "registry.fullname" . }} @@ -19,7 +19,9 @@ spec: - type: Resource resource: name: cpu - targetAverageUtilization: {{ .Values.hpa.cpu.targetAverageUtilization }} + target: + type: Utilization + averageUtilization: {{ .Values.hpa.cpu.targetAverageUtilization }} {{- else -}} {{- toYaml .Values.hpa.customMetrics | nindent 4 -}} {{- end -}} diff --git a/charts/registry/values.yaml b/charts/registry/values.yaml index eca8f8999f..316a5f2560 100644 --- a/charts/registry/values.yaml +++ b/charts/registry/values.yaml @@ -225,7 +225,7 @@ hpa: cpu: targetAverageUtilization: 75 - # Note that the HPA is limited to autoscaling/v2beta1 + # Note that the HPA is limited to autoscaling/v2beta2 customMetrics: [] storage: {} diff --git a/doc/charts/gitlab/mailroom/index.md b/doc/charts/gitlab/mailroom/index.md index 40cffce124..cbf799df29 100644 --- a/doc/charts/gitlab/mailroom/index.md +++ b/doc/charts/gitlab/mailroom/index.md @@ -38,7 +38,7 @@ hpa: cpu: targetAverageUtilization: 75 - # Note that the HPA is limited to autoscaling/v2beta1 + # Note that the HPA is limited to autoscaling/v2beta2 customMetrics: [] networkpolicy: @@ -80,7 +80,7 @@ serviceAccount: | `hpa.minReplicas` | Minimum number of replicas | `1` | | `hpa.maxReplicas` | Maximum number of replicas | `2` | | `hpa.cpu.targetAverageUtilization` | Target value of the average of the resource metric | `75` | -| `hpa.customMetrics` | autoscaling/v2beta1 Metrics contains the specifications for which to use to calculate the desired replica count (overrides the default use of Average CPU Utilization configured in `targetAverageUtilization`) | `[]` | +| `hpa.customMetrics` | autoscaling/v2beta2 Metrics contains the specifications for which to use to calculate the desired replica count (overrides the default use of Average CPU Utilization configured in `targetAverageUtilization`) | `[]` | | `image.pullPolicy` | Mailroom image pull policy | `IfNotPresent` | | `extraEnvFrom` | List of extra environment variables from other data sources to expose| | | `image.pullSecrets` | Mailroom image pull secrets | | diff --git a/doc/charts/registry/index.md b/doc/charts/registry/index.md index 3838d15531..2e54b17594 100644 --- a/doc/charts/registry/index.md +++ b/doc/charts/registry/index.md @@ -154,7 +154,7 @@ If you chose to deploy this chart as a standalone, remove the `registry` at the | `relativeurls` | `false` | Enable the registry to return relative URLs in Location headers. | | `enabled` | `true` | Enable registry flag | | `hpa.cpu.targetAverageUtilization` | `75` | Target value of the average of the resource metric across all relevant pods which governs the HPA | -| `hpa.customMetrics` | `[]` | autoscaling/v2beta1 Metrics contains the specifications for which to use to calculate the desired replica count (overrides the default use of Average CPU Utilization configured in `targetAverageUtilization`) | +| `hpa.customMetrics` | `[]` | autoscaling/v2beta2 Metrics contains the specifications for which to use to calculate the desired replica count (overrides the default use of Average CPU Utilization configured in `targetAverageUtilization`) | | `hpa.minReplicas` | `2` | Minimum number of replicas | | `hpa.maxReplicas` | `10` | Maximum number of replicas | | `httpSecret` | | Https secret | -- GitLab From 8ef9bdd9f37df928a4f62c1dc6c9fcba7864d1da Mon Sep 17 00:00:00 2001 From: Henri Philipps Date: Fri, 6 May 2022 12:23:50 +0200 Subject: [PATCH 02/13] add hpa behavior config for webservice --- charts/gitlab/charts/webservice/templates/hpa.yaml | 7 +++++++ charts/gitlab/charts/webservice/values.yaml | 2 ++ doc/charts/gitlab/webservice/index.md | 1 + 3 files changed, 10 insertions(+) diff --git a/charts/gitlab/charts/webservice/templates/hpa.yaml b/charts/gitlab/charts/webservice/templates/hpa.yaml index 46398ccd5e..c556529ac2 100644 --- a/charts/gitlab/charts/webservice/templates/hpa.yaml +++ b/charts/gitlab/charts/webservice/templates/hpa.yaml @@ -35,6 +35,13 @@ spec: {{- else }} {{- toYaml .hpa.customMetrics | nindent 4 -}} {{- end }} + behavior: + {{- if not .hpa.customBehavior }} + scaleDown: + stabilizationWindowSeconds: {{ .hpa.scaleDownStabilizationWindowSeconds }} + {{- else }} + {{- toYaml .hpa.customBehvior | nindent 4 -}} + {{- end }} {{- end }} {{/* END range deployments */}} {{- end }} diff --git a/charts/gitlab/charts/webservice/values.yaml b/charts/gitlab/charts/webservice/values.yaml index 55a93ccfe9..a367cb08e6 100644 --- a/charts/gitlab/charts/webservice/values.yaml +++ b/charts/gitlab/charts/webservice/values.yaml @@ -123,6 +123,8 @@ puma: hpa: targetAverageValue: 1 customMetrics: # optional replacement of HPA metrics definition + scaleDownStabilizationWindowSeconds: 300 + customBehavior: # optional replacement of HPA behavior definition deployment: # terminationGracePeriodSeconds: 30 diff --git a/doc/charts/gitlab/webservice/index.md b/doc/charts/gitlab/webservice/index.md index d70bf6696d..d12f0db361 100644 --- a/doc/charts/gitlab/webservice/index.md +++ b/doc/charts/gitlab/webservice/index.md @@ -56,6 +56,7 @@ to the `helm install` command using the `--set` flags. | `extraEnvFrom` | | List of extra environment variables from other data sources to expose | | `gitlab.webservice.workhorse.image` | `registry.gitlab.com/gitlab-org/build/cng/gitlab-workhorse-ee` | Workhorse image repository | | `gitlab.webservice.workhorse.tag` | | Workhorse image tag | +| `hpa.scaleDownStabilizationWindowSeconds` | `300` | Set the scaledown stabilization window in seconds (max 3600) | | `hpa.targetAverageValue` | `1` | Set the autoscaling target value | | `sshHostKeys.mount` | `false` | Whether to mount the GitLab Shell secret containing the public SSH keys. | | `sshHostKeys.mountName` | `ssh-host-keys` | Name of the mounted volume. | -- GitLab From 2c1949974cd5a39a417b948ea4e21d7cad79bfb0 Mon Sep 17 00:00:00 2001 From: Henri Philipps Date: Fri, 6 May 2022 12:25:35 +0200 Subject: [PATCH 03/13] add hpa behavior config for sidekiq --- charts/gitlab/charts/sidekiq/templates/hpa.yaml | 3 +++ charts/gitlab/charts/sidekiq/values.yaml | 2 ++ doc/charts/gitlab/sidekiq/index.md | 1 + 3 files changed, 6 insertions(+) diff --git a/charts/gitlab/charts/sidekiq/templates/hpa.yaml b/charts/gitlab/charts/sidekiq/templates/hpa.yaml index 26c72905a0..cca5e5c771 100644 --- a/charts/gitlab/charts/sidekiq/templates/hpa.yaml +++ b/charts/gitlab/charts/sidekiq/templates/hpa.yaml @@ -29,5 +29,8 @@ spec: target: type: AverageValue averageValue: {{ default $.Values.hpa.targetAverageValue $hpa.targetAverageValue }} + behavior: + scaleDown: + stabilizationWindowSeconds: {{ default $.Values.hpa.scaleDownStabilizationWindowSeconds $hpa.scaleDownStabilizationWindowSeconds }} {{- end }} {{- end -}} diff --git a/charts/gitlab/charts/sidekiq/values.yaml b/charts/gitlab/charts/sidekiq/values.yaml index 05d37ba325..6f70984f57 100644 --- a/charts/gitlab/charts/sidekiq/values.yaml +++ b/charts/gitlab/charts/sidekiq/values.yaml @@ -253,6 +253,7 @@ deployment: hpa: targetAverageValue: 350m + scaleDownStabilizationWindowSeconds: 300 timeout: 25 resources: # limits: @@ -280,6 +281,7 @@ pods: # priorityClassName: "" # hpa: # targetAverageValue: + # scaleDownStabilizationWindowSeconds: # common: # labels: {} # podLabels: {} diff --git a/doc/charts/gitlab/sidekiq/index.md b/doc/charts/gitlab/sidekiq/index.md index 69a8a92a2c..16f20ce598 100644 --- a/doc/charts/gitlab/sidekiq/index.md +++ b/doc/charts/gitlab/sidekiq/index.md @@ -54,6 +54,7 @@ to the `helm install` command using the `--set` flags: | `extraEnvFrom` | | List of extra environment variables from other data sources to expose | | `gitaly.serviceName` | `gitaly` | Gitaly service name | | `health_checks.port` | `3808` | Health check server port | +| `hpa.scaleDownStabilizationWindowSeconds` | `300` | | Set the scaledown stabilization window in seconds (max 3600) | | `hpa.targetAverageValue` | `350m` | Set the autoscaling target value | | `minReplicas` | `2` | Minimum number of replicas | | `maxReplicas` | `10` | Maximum number of replicas | -- GitLab From 9795abe4e2d849e7d0b98ed0c041d2d903b66440 Mon Sep 17 00:00:00 2001 From: Henri Philipps Date: Fri, 6 May 2022 12:26:10 +0200 Subject: [PATCH 04/13] add hpa behavior config for mailroon --- charts/gitlab/charts/mailroom/templates/hpa.yaml | 7 +++++++ charts/gitlab/charts/mailroom/values.yaml | 2 ++ doc/charts/gitlab/mailroom/index.md | 4 ++++ 3 files changed, 13 insertions(+) diff --git a/charts/gitlab/charts/mailroom/templates/hpa.yaml b/charts/gitlab/charts/mailroom/templates/hpa.yaml index 18312da9cc..0460c9af7f 100644 --- a/charts/gitlab/charts/mailroom/templates/hpa.yaml +++ b/charts/gitlab/charts/mailroom/templates/hpa.yaml @@ -25,4 +25,11 @@ spec: {{- else -}} {{- toYaml .Values.hpa.customMetrics | nindent 4 -}} {{- end -}} + behavior: + {{- if not .hpa.customBehavior }} + scaleDown: + stabilizationWindowSeconds: {{ .hpa.scaleDownStabilizationWindowSeconds }} + {{- else }} + {{- toYaml .hpa.customBehvior | nindent 4 -}} + {{- end }} {{- end -}} diff --git a/charts/gitlab/charts/mailroom/values.yaml b/charts/gitlab/charts/mailroom/values.yaml index 37fff9c7aa..7d78752c7b 100644 --- a/charts/gitlab/charts/mailroom/values.yaml +++ b/charts/gitlab/charts/mailroom/values.yaml @@ -87,9 +87,11 @@ hpa: maxReplicas: 2 cpu: targetAverageUtilization: 75 + scaleDownStabilizationWindowSeconds: 300 # Note that the HPA is limited to autoscaling/v2beta2 customMetrics: [] + customBehavior: {} # Mailroom does not require inbound connections # This service only requires outgoing connections to the diff --git a/doc/charts/gitlab/mailroom/index.md b/doc/charts/gitlab/mailroom/index.md index cbf799df29..e8b3703904 100644 --- a/doc/charts/gitlab/mailroom/index.md +++ b/doc/charts/gitlab/mailroom/index.md @@ -37,9 +37,11 @@ hpa: maxReplicas: 2 cpu: targetAverageUtilization: 75 + scaleDownStabilizationWindowSeconds: 300 # Note that the HPA is limited to autoscaling/v2beta2 customMetrics: [] + customBehavior: {} networkpolicy: enabled: false @@ -79,7 +81,9 @@ serviceAccount: | `enabled` | Mailroom enablement flag | `true` | | `hpa.minReplicas` | Minimum number of replicas | `1` | | `hpa.maxReplicas` | Maximum number of replicas | `2` | +| `hpa.cpu.scaleDownStabilizationWindowSeconds` | Set the scaledown stabilization window in seconds (max 3600) | `300` | | `hpa.cpu.targetAverageUtilization` | Target value of the average of the resource metric | `75` | +| `hpa.customBehavior` | autoscaling/v2beta2 Behavior contains the specifications for up- and downscaling behavior (overrides the default use of `scaleDownStabilizationWindowSeconds`) | `{}` | | `hpa.customMetrics` | autoscaling/v2beta2 Metrics contains the specifications for which to use to calculate the desired replica count (overrides the default use of Average CPU Utilization configured in `targetAverageUtilization`) | `[]` | | `image.pullPolicy` | Mailroom image pull policy | `IfNotPresent` | | `extraEnvFrom` | List of extra environment variables from other data sources to expose| | -- GitLab From 835f0e372ddb88a01fba18042599775851be228c Mon Sep 17 00:00:00 2001 From: Henri Philipps Date: Fri, 6 May 2022 13:38:31 +0200 Subject: [PATCH 05/13] add hpa behavior config for gitlab-shell --- charts/gitlab/charts/gitlab-shell/templates/hpa.yaml | 3 +++ charts/gitlab/charts/gitlab-shell/values.schema.json | 7 ++++++- charts/gitlab/charts/gitlab-shell/values.yaml | 1 + doc/charts/gitlab/gitlab-shell/index.md | 1 + 4 files changed, 11 insertions(+), 1 deletion(-) diff --git a/charts/gitlab/charts/gitlab-shell/templates/hpa.yaml b/charts/gitlab/charts/gitlab-shell/templates/hpa.yaml index ad870ba173..6cb8c31f31 100644 --- a/charts/gitlab/charts/gitlab-shell/templates/hpa.yaml +++ b/charts/gitlab/charts/gitlab-shell/templates/hpa.yaml @@ -21,4 +21,7 @@ spec: target: type: AverageValue averageValue: {{ .Values.hpa.targetAverageValue }} + behavior: + scaleDown: + stabilizationWindowSeconds: {{ .Values.hpa.scaleDownStabilizationWindowSeconds }} {{- end -}} diff --git a/charts/gitlab/charts/gitlab-shell/values.schema.json b/charts/gitlab/charts/gitlab-shell/values.schema.json index ed5379c526..50f83a79d4 100644 --- a/charts/gitlab/charts/gitlab-shell/values.schema.json +++ b/charts/gitlab/charts/gitlab-shell/values.schema.json @@ -189,10 +189,15 @@ "targetAverageValue": { "title": "Autoscaling target value", "type": "string" + }, + "scaleDownStabilizationWindowSeconds": { + "title": "Autoscaling scale down stabilization window in seconds", + "type": "number" } }, "required": [ - "targetAverageValue" + "targetAverageValue", + "scaleDownStabilizationWindowSeconds" ], "title": "Horizontal Pod Autoscaler settings", "type": "object" diff --git a/charts/gitlab/charts/gitlab-shell/values.yaml b/charts/gitlab/charts/gitlab-shell/values.yaml index e6ad5db2a7..d0cc419fb0 100644 --- a/charts/gitlab/charts/gitlab-shell/values.yaml +++ b/charts/gitlab/charts/gitlab-shell/values.yaml @@ -60,6 +60,7 @@ minReplicas: 2 maxReplicas: 10 hpa: targetAverageValue: 100m + scaleDownStabilizationWindowSeconds: 300 deployment: terminationGracePeriodSeconds: 30 diff --git a/doc/charts/gitlab/gitlab-shell/index.md b/doc/charts/gitlab/gitlab-shell/index.md index 7009bbaa23..49b91dde15 100644 --- a/doc/charts/gitlab/gitlab-shell/index.md +++ b/doc/charts/gitlab/gitlab-shell/index.md @@ -65,6 +65,7 @@ controlled by `global.shell.port`. | `extraVolumes` | | List of extra volumes to create | | `extraEnv` | | List of extra environment variables to expose | | `extraEnvFrom` | | List of extra environment variables from other data sources to expose | +| `hpa.scaleDownStabilizationWindowSeconds` | `300` | Set the scaledown stabilization window in seconds (max 3600) | | `hpa.targetAverageValue` | `100m` | Set the autoscaling target value | | `image.pullPolicy` | `IfNotPresent` | Shell image pull policy | | `image.pullSecrets` | | Secrets for the image repository | -- GitLab From 6d21b41818ee98554f11fb0de9d905fd6a2f4721 Mon Sep 17 00:00:00 2001 From: Henri Philipps Date: Fri, 6 May 2022 13:46:43 +0200 Subject: [PATCH 06/13] add hpa behavior config for kas --- charts/gitlab/charts/kas/templates/hpa.yaml | 3 +++ charts/gitlab/charts/kas/values.yaml | 1 + doc/charts/gitlab/kas/index.md | 1 + 3 files changed, 5 insertions(+) diff --git a/charts/gitlab/charts/kas/templates/hpa.yaml b/charts/gitlab/charts/kas/templates/hpa.yaml index 1890c7cd2e..5d1bc54947 100644 --- a/charts/gitlab/charts/kas/templates/hpa.yaml +++ b/charts/gitlab/charts/kas/templates/hpa.yaml @@ -21,4 +21,7 @@ spec: target: type: AverageValue averageValue: {{ .Values.hpa.targetAverageValue }} + behavior: + scaleDown: + stabilizationWindowSeconds: {{ .Values.hpa.scaleDownStabilizationWindowSeconds }} {{- end -}} diff --git a/charts/gitlab/charts/kas/values.yaml b/charts/gitlab/charts/kas/values.yaml index 666762bcae..9a080bedd2 100644 --- a/charts/gitlab/charts/kas/values.yaml +++ b/charts/gitlab/charts/kas/values.yaml @@ -25,6 +25,7 @@ init: hpa: targetAverageValue: 100m + scaleDownStabilizationWindowSeconds: 300 image: repository: registry.gitlab.com/gitlab-org/build/cng/gitlab-kas # tag: latest diff --git a/doc/charts/gitlab/kas/index.md b/doc/charts/gitlab/kas/index.md index ccc261ad8d..c7ad30d99f 100644 --- a/doc/charts/gitlab/kas/index.md +++ b/doc/charts/gitlab/kas/index.md @@ -68,6 +68,7 @@ You can pass these parameters to the `helm install` command by using the `--set` | `extraContainers` | | List of extra containers to include. | | `image.repository` | `registry.gitlab.com/gitlab-org/build/cng/gitlab-kas` | Image repository. | | `image.tag` | `v13.7.0` | Image tag. | +| `hpa.scaleDownStabilizationWindowSeconds` | `300` | Set the scaledown stabilization window in seconds (max 3600) | | `hpa.targetAverageValue` | `100m` | Set the autoscaling target value (CPU). | | `ingress.enabled` | `true` if `global.kas.enabled=true` | You can use `kas.ingress.enabled` to explicitly turn it on or off. If not set, you can optionally use `global.ingress.enabled` for the same purpose. | | `ingress.apiVersion` | | Value to use in the `apiVersion` field. | -- GitLab From c64e5144475669071cb16640bdc7b948268f39ba Mon Sep 17 00:00:00 2001 From: Henri Philipps Date: Fri, 6 May 2022 14:11:50 +0200 Subject: [PATCH 07/13] add hpa behavior config for gitlab-pages --- charts/gitlab/charts/gitlab-pages/templates/hpa.yaml | 7 +++++++ charts/gitlab/charts/gitlab-pages/values.yaml | 4 +++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/charts/gitlab/charts/gitlab-pages/templates/hpa.yaml b/charts/gitlab/charts/gitlab-pages/templates/hpa.yaml index 340bfe8b40..3fc91425f9 100644 --- a/charts/gitlab/charts/gitlab-pages/templates/hpa.yaml +++ b/charts/gitlab/charts/gitlab-pages/templates/hpa.yaml @@ -24,3 +24,10 @@ spec: {{- else -}} {{- toYaml .Values.hpa.customMetrics | nindent 4 -}} {{- end -}} + behavior: + {{- if not .Values.hpa.customBehavior }} + scaleDown: + stabilizationWindowSeconds: {{ .Values.hpa.scaleDownStabilizationWindowSeconds }} + {{- else }} + {{- toYaml .Values.hpa.customBehavior | nindent 4 -}} + {{- end }} diff --git a/charts/gitlab/charts/gitlab-pages/values.yaml b/charts/gitlab/charts/gitlab-pages/values.yaml index ce936cadea..88ba1ce43b 100644 --- a/charts/gitlab/charts/gitlab-pages/values.yaml +++ b/charts/gitlab/charts/gitlab-pages/values.yaml @@ -13,7 +13,9 @@ hpa: maxReplicas: 10 minReplicas: 1 targetAverageValue: 100m - customMetrics: [] + customMetrics: [] # overrides targetAverageValue + scaleDownStabilizationWindowSeconds: 300 + customBehavior: {} # overrides scaleDownStabilizationWindowSeconds networkpolicy: enabled: false -- GitLab From 1297fecd0e5a57f6efe1d0ce3a2cdc586f34f847 Mon Sep 17 00:00:00 2001 From: Henri Philipps Date: Fri, 6 May 2022 14:12:39 +0200 Subject: [PATCH 08/13] fix typos --- charts/gitlab/charts/mailroom/templates/hpa.yaml | 6 +++--- charts/gitlab/charts/webservice/templates/hpa.yaml | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/charts/gitlab/charts/mailroom/templates/hpa.yaml b/charts/gitlab/charts/mailroom/templates/hpa.yaml index 0460c9af7f..69610bb6ff 100644 --- a/charts/gitlab/charts/mailroom/templates/hpa.yaml +++ b/charts/gitlab/charts/mailroom/templates/hpa.yaml @@ -26,10 +26,10 @@ spec: {{- toYaml .Values.hpa.customMetrics | nindent 4 -}} {{- end -}} behavior: - {{- if not .hpa.customBehavior }} + {{- if not Values.hpa.customBehavior }} scaleDown: - stabilizationWindowSeconds: {{ .hpa.scaleDownStabilizationWindowSeconds }} + stabilizationWindowSeconds: {{ .Values.hpa.scaleDownStabilizationWindowSeconds }} {{- else }} - {{- toYaml .hpa.customBehvior | nindent 4 -}} + {{- toYaml .Values.hpa.customBehavior | nindent 4 -}} {{- end }} {{- end -}} diff --git a/charts/gitlab/charts/webservice/templates/hpa.yaml b/charts/gitlab/charts/webservice/templates/hpa.yaml index c556529ac2..2adaf95253 100644 --- a/charts/gitlab/charts/webservice/templates/hpa.yaml +++ b/charts/gitlab/charts/webservice/templates/hpa.yaml @@ -40,7 +40,7 @@ spec: scaleDown: stabilizationWindowSeconds: {{ .hpa.scaleDownStabilizationWindowSeconds }} {{- else }} - {{- toYaml .hpa.customBehvior | nindent 4 -}} + {{- toYaml .hpa.customBehavior | nindent 4 -}} {{- end }} {{- end }} {{/* END range deployments */}} -- GitLab From 4a20933d21b17b4c1f12b89b4d75646c9d81c1a3 Mon Sep 17 00:00:00 2001 From: Henri Philipps Date: Fri, 6 May 2022 14:24:46 +0200 Subject: [PATCH 09/13] add hpa behavior config for spamcheck --- charts/gitlab/charts/spamcheck/templates/hpa.yaml | 7 +++++++ charts/gitlab/charts/spamcheck/values.yaml | 1 + doc/charts/gitlab/spamcheck/index.md | 1 + 3 files changed, 9 insertions(+) diff --git a/charts/gitlab/charts/spamcheck/templates/hpa.yaml b/charts/gitlab/charts/spamcheck/templates/hpa.yaml index 00b28accc8..6e37fb896e 100644 --- a/charts/gitlab/charts/spamcheck/templates/hpa.yaml +++ b/charts/gitlab/charts/spamcheck/templates/hpa.yaml @@ -25,4 +25,11 @@ spec: {{- else -}} {{- toYaml .Values.hpa.customMetrics | nindent 4 -}} {{- end -}} + behavior: + {{- if not Values.hpa.customBehavior }} + scaleDown: + stabilizationWindowSeconds: {{ .Values.hpa.scaleDownStabilizationWindowSeconds }} + {{- else }} + {{- toYaml .Values.hpa.customBehavior | nindent 4 -}} + {{- end }} {{- end }} diff --git a/charts/gitlab/charts/spamcheck/values.yaml b/charts/gitlab/charts/spamcheck/values.yaml index 281c494cfa..f78d95bb10 100644 --- a/charts/gitlab/charts/spamcheck/values.yaml +++ b/charts/gitlab/charts/spamcheck/values.yaml @@ -10,6 +10,7 @@ hpa: maxReplicas: 10 minReplicas: 1 targetAverageValue: 100m + scaleDownStabilizationWindowSeconds: 300 image: repository: registry.gitlab.com/gitlab-com/gl-security/engineering-and-research/automation-team/spam/spamcheck diff --git a/doc/charts/gitlab/spamcheck/index.md b/doc/charts/gitlab/spamcheck/index.md index 279f431a0a..dd5ddf8c43 100644 --- a/doc/charts/gitlab/spamcheck/index.md +++ b/doc/charts/gitlab/spamcheck/index.md @@ -56,6 +56,7 @@ The table below contains all the possible charts configurations that can be supp | `deployment.readinessProbe.successThreshold` | 1 | Minimum consecutive successes for the readiness probe to be considered successful after having failed | | `deployment.readinessProbe.failureThreshold` | 3 | Minimum consecutive failures for the readiness probe to be considered failed after having succeeded | | `deployment.strategy` | `{}` | Allows one to configure the update strategy used by the deployment. When not provided, the cluster default is used. | +| `hpa.scaleDownStabilizationWindowSeconds` | `300` | Set the scaledown stabilization window in seconds (max 3600) | | `hpa.targetAverageValue` | `100m` | Set the autoscaling target value (CPU) | | `image.repository` | `registry.gitlab.com/gitlab-com/gl-security/engineering-and-research/automation-team/spam/spamcheck` | Spamcheck image repository | | `logging.format` | `json` | Log format | -- GitLab From 5e2708d359eeefec64e67e7550ae9e3c0615d3bf Mon Sep 17 00:00:00 2001 From: Henri Philipps Date: Fri, 6 May 2022 14:38:02 +0200 Subject: [PATCH 10/13] add hpa behavior config for registry --- charts/registry/templates/hpa.yaml | 7 +++++++ charts/registry/values.yaml | 6 ++++-- doc/charts/registry/index.md | 3 +++ 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/charts/registry/templates/hpa.yaml b/charts/registry/templates/hpa.yaml index 6df3e5fc3e..1562ef2029 100644 --- a/charts/registry/templates/hpa.yaml +++ b/charts/registry/templates/hpa.yaml @@ -25,4 +25,11 @@ spec: {{- else -}} {{- toYaml .Values.hpa.customMetrics | nindent 4 -}} {{- end -}} + behavior: + {{- if not Values.hpa.customBehavior }} + scaleDown: + stabilizationWindowSeconds: {{ .Values.hpa.scaleDownStabilizationWindowSeconds }} + {{- else }} + {{- toYaml .Values.hpa.customBehavior | nindent 4 -}} + {{- end }} {{- end -}} diff --git a/charts/registry/values.yaml b/charts/registry/values.yaml index 316a5f2560..46d1c52884 100644 --- a/charts/registry/values.yaml +++ b/charts/registry/values.yaml @@ -224,9 +224,11 @@ hpa: maxReplicas: 10 cpu: targetAverageUtilization: 75 + scaleDownStabilizationWindowSeconds: 300 - # Note that the HPA is limited to autoscaling/v2beta2 - customMetrics: [] + # Note that the HPA is limited to autoscaling/v2beta2. + customMetrics: [] # Overrides targetAverageUtilization + customBehavior: {} # Overrides scaleDownStabilizationWindowSeconds storage: {} # secret: diff --git a/doc/charts/registry/index.md b/doc/charts/registry/index.md index 2e54b17594..e16ee51e90 100644 --- a/doc/charts/registry/index.md +++ b/doc/charts/registry/index.md @@ -90,6 +90,7 @@ registry: maxReplicas: 10 cpu: targetAverageUtilization: 75 + scaleDownStabilizationWindowSeconds: 300 storage: secret: key: storage @@ -154,9 +155,11 @@ If you chose to deploy this chart as a standalone, remove the `registry` at the | `relativeurls` | `false` | Enable the registry to return relative URLs in Location headers. | | `enabled` | `true` | Enable registry flag | | `hpa.cpu.targetAverageUtilization` | `75` | Target value of the average of the resource metric across all relevant pods which governs the HPA | +| `hpa.customBehavior` | `{}` | autoscaling/v2beta2 Behavior contains the specifications for up- and downscaling behavior (overrides the default use of `scaleDownStabilizationWindowSeconds`) | | `hpa.customMetrics` | `[]` | autoscaling/v2beta2 Metrics contains the specifications for which to use to calculate the desired replica count (overrides the default use of Average CPU Utilization configured in `targetAverageUtilization`) | | `hpa.minReplicas` | `2` | Minimum number of replicas | | `hpa.maxReplicas` | `10` | Maximum number of replicas | +| `hpa.scaleDownStabilizationWindowSeconds` | `300` | Set the scaledown stabilization window in seconds (max 3600) | | `httpSecret` | | Https secret | | `extraEnvFrom` | | List of extra environment variables from other data sources to expose | | `image.pullPolicy` | | Pull policy for the registry image | -- GitLab From fec8aa8b4155280ae1ce1fd89a5e02ea9ee9a126 Mon Sep 17 00:00:00 2001 From: Henri Philipps Date: Fri, 6 May 2022 16:41:15 +0200 Subject: [PATCH 11/13] fix hpa yaml whitespaces --- charts/gitlab/charts/gitlab-pages/templates/hpa.yaml | 4 ++-- charts/gitlab/charts/mailroom/templates/hpa.yaml | 6 +++--- charts/gitlab/charts/spamcheck/templates/hpa.yaml | 6 +++--- charts/registry/templates/hpa.yaml | 4 ++-- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/charts/gitlab/charts/gitlab-pages/templates/hpa.yaml b/charts/gitlab/charts/gitlab-pages/templates/hpa.yaml index 3fc91425f9..dc20e108c2 100644 --- a/charts/gitlab/charts/gitlab-pages/templates/hpa.yaml +++ b/charts/gitlab/charts/gitlab-pages/templates/hpa.yaml @@ -21,9 +21,9 @@ spec: target: type: AverageValue averageValue: {{ .Values.hpa.targetAverageValue }} - {{- else -}} + {{- else }} {{- toYaml .Values.hpa.customMetrics | nindent 4 -}} - {{- end -}} + {{- end }} behavior: {{- if not .Values.hpa.customBehavior }} scaleDown: diff --git a/charts/gitlab/charts/mailroom/templates/hpa.yaml b/charts/gitlab/charts/mailroom/templates/hpa.yaml index 69610bb6ff..2dbcd1a431 100644 --- a/charts/gitlab/charts/mailroom/templates/hpa.yaml +++ b/charts/gitlab/charts/mailroom/templates/hpa.yaml @@ -24,12 +24,12 @@ spec: averageUtilization: {{ .Values.hpa.cpu.targetAverageUtilization }} {{- else -}} {{- toYaml .Values.hpa.customMetrics | nindent 4 -}} - {{- end -}} + {{- end }} behavior: - {{- if not Values.hpa.customBehavior }} + {{- if not .Values.hpa.customBehavior }} scaleDown: stabilizationWindowSeconds: {{ .Values.hpa.scaleDownStabilizationWindowSeconds }} {{- else }} {{- toYaml .Values.hpa.customBehavior | nindent 4 -}} {{- end }} -{{- end -}} +{{- end }} diff --git a/charts/gitlab/charts/spamcheck/templates/hpa.yaml b/charts/gitlab/charts/spamcheck/templates/hpa.yaml index 6e37fb896e..2e733bdd78 100644 --- a/charts/gitlab/charts/spamcheck/templates/hpa.yaml +++ b/charts/gitlab/charts/spamcheck/templates/hpa.yaml @@ -22,11 +22,11 @@ spec: target: type: AverageValue averageValue: {{ .Values.hpa.targetAverageValue }} - {{- else -}} + {{- else }} {{- toYaml .Values.hpa.customMetrics | nindent 4 -}} - {{- end -}} + {{- end }} behavior: - {{- if not Values.hpa.customBehavior }} + {{- if not .Values.hpa.customBehavior }} scaleDown: stabilizationWindowSeconds: {{ .Values.hpa.scaleDownStabilizationWindowSeconds }} {{- else }} diff --git a/charts/registry/templates/hpa.yaml b/charts/registry/templates/hpa.yaml index 1562ef2029..35b7a419aa 100644 --- a/charts/registry/templates/hpa.yaml +++ b/charts/registry/templates/hpa.yaml @@ -24,9 +24,9 @@ spec: averageUtilization: {{ .Values.hpa.cpu.targetAverageUtilization }} {{- else -}} {{- toYaml .Values.hpa.customMetrics | nindent 4 -}} - {{- end -}} + {{- end }} behavior: - {{- if not Values.hpa.customBehavior }} + {{- if not .Values.hpa.customBehavior }} scaleDown: stabilizationWindowSeconds: {{ .Values.hpa.scaleDownStabilizationWindowSeconds }} {{- else }} -- GitLab From eeab4b644d5977dd18ebebd4dcf4dd261be90ff6 Mon Sep 17 00:00:00 2001 From: Pierre Guinoiseau Date: Fri, 10 Jun 2022 18:25:58 +1200 Subject: [PATCH 12/13] Keep compatibility with autoscaling/v2beta1 and simplify behaviour configuration in all HPAs --- .../charts/gitlab-pages/templates/hpa.yaml | 20 ++- charts/gitlab/charts/gitlab-pages/values.yaml | 8 +- .../charts/gitlab-shell/templates/hpa.yaml | 28 ++-- .../charts/gitlab-shell/values.schema.json | 9 +- charts/gitlab/charts/gitlab-shell/values.yaml | 4 +- charts/gitlab/charts/kas/templates/hpa.yaml | 28 ++-- charts/gitlab/charts/kas/values.yaml | 5 +- .../gitlab/charts/mailroom/templates/hpa.yaml | 18 ++- charts/gitlab/charts/mailroom/values.yaml | 10 +- .../gitlab/charts/sidekiq/templates/hpa.yaml | 27 ++-- charts/gitlab/charts/sidekiq/values.yaml | 9 +- .../charts/spamcheck/templates/hpa.yaml | 18 ++- charts/gitlab/charts/spamcheck/values.yaml | 4 +- .../charts/webservice/templates/hpa.yaml | 31 ++-- charts/gitlab/charts/webservice/values.yaml | 8 +- .../templates/controller-hpa.yaml | 41 ++++-- .../templates/default-backend-hpa.yaml | 27 +++- charts/nginx-ingress/values.yaml | 1 + charts/registry/templates/hpa.yaml | 18 ++- charts/registry/values.yaml | 10 +- doc/charts/gitlab/gitlab-pages/index.md | 79 ++++++----- doc/charts/gitlab/gitlab-shell/index.md | 132 +++++++++--------- doc/charts/gitlab/kas/index.md | 94 ++++++------- doc/charts/gitlab/mailroom/index.md | 72 +++++----- doc/charts/gitlab/sidekiq/index.md | 128 ++++++++--------- doc/charts/gitlab/spamcheck/index.md | 78 +++++------ doc/charts/gitlab/webservice/index.md | 6 +- doc/charts/registry/index.md | 11 +- 28 files changed, 525 insertions(+), 399 deletions(-) diff --git a/charts/gitlab/charts/gitlab-pages/templates/hpa.yaml b/charts/gitlab/charts/gitlab-pages/templates/hpa.yaml index dc20e108c2..3a9698037c 100644 --- a/charts/gitlab/charts/gitlab-pages/templates/hpa.yaml +++ b/charts/gitlab/charts/gitlab-pages/templates/hpa.yaml @@ -1,4 +1,9 @@ +--- +{{- if .Capabilities.APIVersions.Has "autoscaling/v2beta2" }} apiVersion: autoscaling/v2beta2 +{{- else }} +apiVersion: autoscaling/v2beta1 +{{- end }} kind: HorizontalPodAutoscaler metadata: name: {{ template "fullname" . }} @@ -18,16 +23,19 @@ spec: - type: Resource resource: name: cpu + {{- if .Capabilities.APIVersions.Has "autoscaling/v2beta2" }} target: type: AverageValue averageValue: {{ .Values.hpa.targetAverageValue }} + {{- else }} + targetAverageValue: {{ .Values.hpa.targetAverageValue }} + {{- end }} {{- else }} - {{- toYaml .Values.hpa.customMetrics | nindent 4 -}} + {{- toYaml .Values.hpa.customMetrics | nindent 4 }} {{- end }} + {{- if .Capabilities.APIVersions.Has "autoscaling/v2beta2" }} + {{- with .Values.hpa.behaviour }} behavior: - {{- if not .Values.hpa.customBehavior }} - scaleDown: - stabilizationWindowSeconds: {{ .Values.hpa.scaleDownStabilizationWindowSeconds }} - {{- else }} - {{- toYaml .Values.hpa.customBehavior | nindent 4 -}} + {{- toYaml . | nindent 4 }} + {{- end }} {{- end }} diff --git a/charts/gitlab/charts/gitlab-pages/values.yaml b/charts/gitlab/charts/gitlab-pages/values.yaml index 88ba1ce43b..c048f32c11 100644 --- a/charts/gitlab/charts/gitlab-pages/values.yaml +++ b/charts/gitlab/charts/gitlab-pages/values.yaml @@ -13,9 +13,11 @@ hpa: maxReplicas: 10 minReplicas: 1 targetAverageValue: 100m - customMetrics: [] # overrides targetAverageValue - scaleDownStabilizationWindowSeconds: 300 - customBehavior: {} # overrides scaleDownStabilizationWindowSeconds + # Note that the HPA is limited to autoscaling/v2beta1 and autoscaling/v2beta2 + customMetrics: [] # Overrides HPA metrics definition + behaviour: + scaleDown: + stabilizationWindowSeconds: 300 networkpolicy: enabled: false diff --git a/charts/gitlab/charts/gitlab-shell/templates/hpa.yaml b/charts/gitlab/charts/gitlab-shell/templates/hpa.yaml index 6cb8c31f31..14c1c2cdeb 100644 --- a/charts/gitlab/charts/gitlab-shell/templates/hpa.yaml +++ b/charts/gitlab/charts/gitlab-shell/templates/hpa.yaml @@ -1,5 +1,10 @@ {{- if .Values.enabled -}} +--- +{{- if .Capabilities.APIVersions.Has "autoscaling/v2beta2" }} apiVersion: autoscaling/v2beta2 +{{- else }} +apiVersion: autoscaling/v2beta1 +{{- end }} kind: HorizontalPodAutoscaler metadata: name: {{ template "fullname" . }} @@ -15,13 +20,20 @@ spec: minReplicas: {{ .Values.minReplicas }} maxReplicas: {{ .Values.maxReplicas }} metrics: - - type: Resource - resource: - name: cpu - target: - type: AverageValue - averageValue: {{ .Values.hpa.targetAverageValue }} + - type: Resource + resource: + name: cpu + {{- if .Capabilities.APIVersions.Has "autoscaling/v2beta2" }} + target: + type: AverageValue + averageValue: {{ .Values.hpa.targetAverageValue }} + {{- else }} + targetAverageValue: {{ .Values.hpa.targetAverageValue }} + {{- end }} + {{- if .Capabilities.APIVersions.Has "autoscaling/v2beta2" }} + {{- with .Values.hpa.behaviour }} behavior: - scaleDown: - stabilizationWindowSeconds: {{ .Values.hpa.scaleDownStabilizationWindowSeconds }} + {{- toYaml . | nindent 4 }} + {{- end }} + {{- end }} {{- end -}} diff --git a/charts/gitlab/charts/gitlab-shell/values.schema.json b/charts/gitlab/charts/gitlab-shell/values.schema.json index 50f83a79d4..123fdf28c3 100644 --- a/charts/gitlab/charts/gitlab-shell/values.schema.json +++ b/charts/gitlab/charts/gitlab-shell/values.schema.json @@ -190,14 +190,13 @@ "title": "Autoscaling target value", "type": "string" }, - "scaleDownStabilizationWindowSeconds": { - "title": "Autoscaling scale down stabilization window in seconds", - "type": "number" + "behaviour": { + "title": "Autoscaling behaviour definition", + "type": "object" } }, "required": [ - "targetAverageValue", - "scaleDownStabilizationWindowSeconds" + "targetAverageValue" ], "title": "Horizontal Pod Autoscaler settings", "type": "object" diff --git a/charts/gitlab/charts/gitlab-shell/values.yaml b/charts/gitlab/charts/gitlab-shell/values.yaml index d0cc419fb0..3bdd7cbf0c 100644 --- a/charts/gitlab/charts/gitlab-shell/values.yaml +++ b/charts/gitlab/charts/gitlab-shell/values.yaml @@ -60,7 +60,9 @@ minReplicas: 2 maxReplicas: 10 hpa: targetAverageValue: 100m - scaleDownStabilizationWindowSeconds: 300 + behaviour: + scaleDown: + stabilizationWindowSeconds: 300 deployment: terminationGracePeriodSeconds: 30 diff --git a/charts/gitlab/charts/kas/templates/hpa.yaml b/charts/gitlab/charts/kas/templates/hpa.yaml index 5d1bc54947..430c7cdf16 100644 --- a/charts/gitlab/charts/kas/templates/hpa.yaml +++ b/charts/gitlab/charts/kas/templates/hpa.yaml @@ -1,5 +1,10 @@ {{- if .Values.global.kas.enabled -}} +--- +{{- if .Capabilities.APIVersions.Has "autoscaling/v2beta2" }} apiVersion: autoscaling/v2beta2 +{{- else }} +apiVersion: autoscaling/v2beta1 +{{- end }} kind: HorizontalPodAutoscaler metadata: name: {{ template "fullname" . }} @@ -15,13 +20,20 @@ spec: minReplicas: {{ .Values.minReplicas }} maxReplicas: {{ .Values.maxReplicas }} metrics: - - type: Resource - resource: - name: cpu - target: - type: AverageValue - averageValue: {{ .Values.hpa.targetAverageValue }} + - type: Resource + resource: + name: cpu + {{- if .Capabilities.APIVersions.Has "autoscaling/v2beta2" }} + target: + type: AverageValue + averageValue: {{ .Values.hpa.targetAverageValue }} + {{- else }} + targetAverageValue: {{ .Values.hpa.targetAverageValue }} + {{- end }} + {{- if .Capabilities.APIVersions.Has "autoscaling/v2beta2" }} + {{- with .Values.hpa.behaviour }} behavior: - scaleDown: - stabilizationWindowSeconds: {{ .Values.hpa.scaleDownStabilizationWindowSeconds }} + {{- toYaml . | nindent 4 }} + {{- end }} + {{- end }} {{- end -}} diff --git a/charts/gitlab/charts/kas/values.yaml b/charts/gitlab/charts/kas/values.yaml index 9a080bedd2..7f28462c0d 100644 --- a/charts/gitlab/charts/kas/values.yaml +++ b/charts/gitlab/charts/kas/values.yaml @@ -25,7 +25,10 @@ init: hpa: targetAverageValue: 100m - scaleDownStabilizationWindowSeconds: 300 + behaviour: + scaleDown: + stabilizationWindowSeconds: 300 + image: repository: registry.gitlab.com/gitlab-org/build/cng/gitlab-kas # tag: latest diff --git a/charts/gitlab/charts/mailroom/templates/hpa.yaml b/charts/gitlab/charts/mailroom/templates/hpa.yaml index 2dbcd1a431..bbcf373ca4 100644 --- a/charts/gitlab/charts/mailroom/templates/hpa.yaml +++ b/charts/gitlab/charts/mailroom/templates/hpa.yaml @@ -1,5 +1,10 @@ {{- if and .Values.enabled .Values.global.appConfig.incomingEmail.enabled }} +--- +{{- if .Capabilities.APIVersions.Has "autoscaling/v2beta2" }} apiVersion: autoscaling/v2beta2 +{{- else }} +apiVersion: autoscaling/v2beta1 +{{- end }} kind: HorizontalPodAutoscaler metadata: name: {{ template "fullname" . }} @@ -19,17 +24,20 @@ spec: - type: Resource resource: name: cpu + {{- if .Capabilities.APIVersions.Has "autoscaling/v2beta2" }} target: type: Utilization averageUtilization: {{ .Values.hpa.cpu.targetAverageUtilization }} + {{- else }} + targetAverageUtilization: {{ .Values.hpa.cpu.targetAverageUtilization }} + {{- end }} {{- else -}} {{- toYaml .Values.hpa.customMetrics | nindent 4 -}} {{- end }} + {{- if .Capabilities.APIVersions.Has "autoscaling/v2beta2" }} + {{- with .Values.hpa.behaviour }} behavior: - {{- if not .Values.hpa.customBehavior }} - scaleDown: - stabilizationWindowSeconds: {{ .Values.hpa.scaleDownStabilizationWindowSeconds }} - {{- else }} - {{- toYaml .Values.hpa.customBehavior | nindent 4 -}} + {{- toYaml . | nindent 4 }} + {{- end }} {{- end }} {{- end }} diff --git a/charts/gitlab/charts/mailroom/values.yaml b/charts/gitlab/charts/mailroom/values.yaml index 7d78752c7b..dc7b86f377 100644 --- a/charts/gitlab/charts/mailroom/values.yaml +++ b/charts/gitlab/charts/mailroom/values.yaml @@ -87,11 +87,11 @@ hpa: maxReplicas: 2 cpu: targetAverageUtilization: 75 - scaleDownStabilizationWindowSeconds: 300 - - # Note that the HPA is limited to autoscaling/v2beta2 - customMetrics: [] - customBehavior: {} + # Note that the HPA is limited to autoscaling/v2beta1 and autoscaling/v2beta2 + customMetrics: [] # Overrides HPA metrics definition + behaviour: + scaleDown: + stabilizationWindowSeconds: 300 # Mailroom does not require inbound connections # This service only requires outgoing connections to the diff --git a/charts/gitlab/charts/sidekiq/templates/hpa.yaml b/charts/gitlab/charts/sidekiq/templates/hpa.yaml index cca5e5c771..712090dffc 100644 --- a/charts/gitlab/charts/sidekiq/templates/hpa.yaml +++ b/charts/gitlab/charts/sidekiq/templates/hpa.yaml @@ -7,7 +7,11 @@ {{- $hpa := default dict .hpa }} {{- include "sidekiq.pod.common.labels" . }} --- +{{- if $.Capabilities.APIVersions.Has "autoscaling/v2beta2" }} apiVersion: autoscaling/v2beta2 +{{- else }} +apiVersion: autoscaling/v2beta1 +{{- end }} kind: HorizontalPodAutoscaler metadata: name: {{ printf "%s-v2" ($queueName | trunc 60) }} @@ -23,14 +27,21 @@ spec: minReplicas: {{ default $.Values.minReplicas .minReplicas }} maxReplicas: {{ default $.Values.maxReplicas .maxReplicas }} metrics: - - type: Resource - resource: - name: cpu - target: - type: AverageValue - averageValue: {{ default $.Values.hpa.targetAverageValue $hpa.targetAverageValue }} + - type: Resource + resource: + name: cpu + {{- if $.Capabilities.APIVersions.Has "autoscaling/v2beta2" }} + target: + type: AverageValue + averageValue: {{ default $.Values.hpa.targetAverageValue $hpa.targetAverageValue }} + {{- else }} + targetAverageValue: {{ default $.Values.hpa.targetAverageValue $hpa.targetAverageValue }} + {{- end }} + {{- if $.Capabilities.APIVersions.Has "autoscaling/v2beta2" }} + {{- with default $.Values.hpa.behaviour $hpa.behaviour }} behavior: - scaleDown: - stabilizationWindowSeconds: {{ default $.Values.hpa.scaleDownStabilizationWindowSeconds $hpa.scaleDownStabilizationWindowSeconds }} + {{- toYaml . | nindent 4 }} + {{- end }} + {{- end }} {{- end }} {{- end -}} diff --git a/charts/gitlab/charts/sidekiq/values.yaml b/charts/gitlab/charts/sidekiq/values.yaml index 6f70984f57..f4c77c2122 100644 --- a/charts/gitlab/charts/sidekiq/values.yaml +++ b/charts/gitlab/charts/sidekiq/values.yaml @@ -253,7 +253,10 @@ deployment: hpa: targetAverageValue: 350m - scaleDownStabilizationWindowSeconds: 300 + behaviour: + scaleDown: + stabilizationWindowSeconds: 300 + timeout: 25 resources: # limits: @@ -281,7 +284,9 @@ pods: # priorityClassName: "" # hpa: # targetAverageValue: - # scaleDownStabilizationWindowSeconds: + # behaviour: + # scaleDown: + # stabilizationWindowSeconds: # common: # labels: {} # podLabels: {} diff --git a/charts/gitlab/charts/spamcheck/templates/hpa.yaml b/charts/gitlab/charts/spamcheck/templates/hpa.yaml index 2e733bdd78..de430ad03f 100644 --- a/charts/gitlab/charts/spamcheck/templates/hpa.yaml +++ b/charts/gitlab/charts/spamcheck/templates/hpa.yaml @@ -1,5 +1,10 @@ {{- if .Values.global.spamcheck.enabled -}} +--- +{{- if .Capabilities.APIVersions.Has "autoscaling/v2beta2" }} apiVersion: autoscaling/v2beta2 +{{- else }} +apiVersion: autoscaling/v2beta1 +{{- end }} kind: HorizontalPodAutoscaler metadata: name: {{ template "fullname" . }} @@ -19,17 +24,20 @@ spec: - type: Resource resource: name: cpu + {{- if .Capabilities.APIVersions.Has "autoscaling/v2beta2" }} target: type: AverageValue averageValue: {{ .Values.hpa.targetAverageValue }} + {{- else }} + targetAverageValue: {{ .Values.hpa.targetAverageValue }} + {{- end }} {{- else }} {{- toYaml .Values.hpa.customMetrics | nindent 4 -}} {{- end }} + {{- if .Capabilities.APIVersions.Has "autoscaling/v2beta2" }} + {{- with .Values.hpa.behaviour }} behavior: - {{- if not .Values.hpa.customBehavior }} - scaleDown: - stabilizationWindowSeconds: {{ .Values.hpa.scaleDownStabilizationWindowSeconds }} - {{- else }} - {{- toYaml .Values.hpa.customBehavior | nindent 4 -}} + {{- toYaml . | nindent 4 }} + {{- end }} {{- end }} {{- end }} diff --git a/charts/gitlab/charts/spamcheck/values.yaml b/charts/gitlab/charts/spamcheck/values.yaml index f78d95bb10..9e5425c157 100644 --- a/charts/gitlab/charts/spamcheck/values.yaml +++ b/charts/gitlab/charts/spamcheck/values.yaml @@ -10,7 +10,9 @@ hpa: maxReplicas: 10 minReplicas: 1 targetAverageValue: 100m - scaleDownStabilizationWindowSeconds: 300 + behaviour: + scaleDown: + stabilizationWindowSeconds: 300 image: repository: registry.gitlab.com/gitlab-com/gl-security/engineering-and-research/automation-team/spam/spamcheck diff --git a/charts/gitlab/charts/webservice/templates/hpa.yaml b/charts/gitlab/charts/webservice/templates/hpa.yaml index 2adaf95253..babb6be0c9 100644 --- a/charts/gitlab/charts/webservice/templates/hpa.yaml +++ b/charts/gitlab/charts/webservice/templates/hpa.yaml @@ -8,7 +8,11 @@ From here on: - `.name` is the key (xyz) */}} --- +{{- if $.Capabilities.APIVersions.Has "autoscaling/v2beta2" }} apiVersion: autoscaling/v2beta2 +{{- else }} +apiVersion: autoscaling/v2beta1 +{{- end }} kind: HorizontalPodAutoscaler metadata: name: {{ template "webservice.fullname.withSuffix" . }} @@ -26,21 +30,24 @@ spec: maxReplicas: {{ .hpa.maxReplicas }} metrics: {{- if not .hpa.customMetrics }} - - type: Resource - resource: - name: cpu - target: - type: AverageValue - averageValue: {{ .hpa.targetAverageValue }} + - type: Resource + resource: + name: cpu + {{- if $.Capabilities.APIVersions.Has "autoscaling/v2beta2" }} + target: + type: AverageValue + averageValue: {{ .hpa.targetAverageValue }} + {{- else }} + targetAverageValue: {{ .hpa.targetAverageValue }} + {{- end }} {{- else }} - {{- toYaml .hpa.customMetrics | nindent 4 -}} + {{- toYaml .hpa.customMetrics | nindent 4 }} {{- end }} + {{- if $.Capabilities.APIVersions.Has "autoscaling/v2beta2" }} + {{- with .hpa.behaviour }} behavior: - {{- if not .hpa.customBehavior }} - scaleDown: - stabilizationWindowSeconds: {{ .hpa.scaleDownStabilizationWindowSeconds }} - {{- else }} - {{- toYaml .hpa.customBehavior | nindent 4 -}} + {{- toYaml . | nindent 4 }} + {{- end }} {{- end }} {{- end }} {{/* END range deployments */}} diff --git a/charts/gitlab/charts/webservice/values.yaml b/charts/gitlab/charts/webservice/values.yaml index a367cb08e6..0036b62603 100644 --- a/charts/gitlab/charts/webservice/values.yaml +++ b/charts/gitlab/charts/webservice/values.yaml @@ -122,9 +122,11 @@ puma: hpa: targetAverageValue: 1 - customMetrics: # optional replacement of HPA metrics definition - scaleDownStabilizationWindowSeconds: 300 - customBehavior: # optional replacement of HPA behavior definition + # Note that the HPA is limited to autoscaling/v2beta1 and autoscaling/v2beta2 + customMetrics: [] # Overrides HPA metrics definition + behaviour: + scaleDown: + stabilizationWindowSeconds: 300 deployment: # terminationGracePeriodSeconds: 30 diff --git a/charts/nginx-ingress/templates/controller-hpa.yaml b/charts/nginx-ingress/templates/controller-hpa.yaml index 37e050d11a..ff9dffaccc 100644 --- a/charts/nginx-ingress/templates/controller-hpa.yaml +++ b/charts/nginx-ingress/templates/controller-hpa.yaml @@ -1,7 +1,11 @@ {{- if and .Values.controller.autoscaling.enabled (or (eq .Values.controller.kind "Deployment") (eq .Values.controller.kind "Both")) -}} {{- if not .Values.controller.keda.enabled }} - +--- +{{- if .Capabilities.APIVersions.Has "autoscaling/v2beta2" }} apiVersion: autoscaling/v2beta2 +{{- else }} +apiVersion: autoscaling/v2beta1 +{{- end }} kind: HorizontalPodAutoscaler metadata: annotations: @@ -25,28 +29,37 @@ spec: maxReplicas: {{ .Values.controller.autoscaling.maxReplicas }} metrics: {{- with .Values.controller.autoscaling.targetMemoryUtilizationPercentage }} - - type: Resource - resource: - name: memory - target: - type: Utilization - averageUtilization: {{ . }} + - type: Resource + resource: + name: memory + {{- if $.Capabilities.APIVersions.Has "autoscaling/v2beta2" }} + target: + type: Utilization + averageUtilization: {{ . }} + {{- else }} + targetAverageUtilization: {{ . }} + {{- end }} {{- end }} {{- with .Values.controller.autoscaling.targetCPUUtilizationPercentage }} - - type: Resource - resource: - name: cpu - target: - type: Utilization - averageUtilization: {{ . }} + - type: Resource + resource: + name: cpu + {{- if $.Capabilities.APIVersions.Has "autoscaling/v2beta2" }} + target: + type: Utilization + averageUtilization: {{ . }} + {{- else }} + targetAverageUtilization: {{ . }} + {{- end }} {{- end }} {{- with .Values.controller.autoscalingTemplate }} {{- toYaml . | nindent 2 }} {{- end }} + {{- if .Capabilities.APIVersions.Has "autoscaling/v2beta2" }} {{- with .Values.controller.autoscaling.behavior }} behavior: {{- toYaml . | nindent 4 }} {{- end }} + {{- end }} {{- end }} {{- end }} - diff --git a/charts/nginx-ingress/templates/default-backend-hpa.yaml b/charts/nginx-ingress/templates/default-backend-hpa.yaml index 035d3a2f32..085517b909 100644 --- a/charts/nginx-ingress/templates/default-backend-hpa.yaml +++ b/charts/nginx-ingress/templates/default-backend-hpa.yaml @@ -1,5 +1,10 @@ {{- if and .Values.defaultBackend.enabled .Values.defaultBackend.autoscaling.enabled }} +--- +{{- if .Capabilities.APIVersions.Has "autoscaling/v2beta2" }} apiVersion: autoscaling/v2beta2 +{{- else }} +apiVersion: autoscaling/v2beta1 +{{- end }} kind: HorizontalPodAutoscaler metadata: labels: @@ -18,20 +23,34 @@ spec: minReplicas: {{ .Values.defaultBackend.autoscaling.minReplicas }} maxReplicas: {{ .Values.defaultBackend.autoscaling.maxReplicas }} metrics: -{{- with .Values.defaultBackend.autoscaling.targetCPUUtilizationPercentage }} + {{- with .Values.defaultBackend.autoscaling.targetCPUUtilizationPercentage }} - type: Resource resource: name: cpu + {{- if $.Capabilities.APIVersions.Has "autoscaling/v2beta2" }} target: type: Utilization averageUtilization: {{ . }} -{{- end }} -{{- with .Values.defaultBackend.autoscaling.targetMemoryUtilizationPercentage }} + {{- else }} + targetAverageUtilization: {{ . }} + {{- end }} + {{- end }} + {{- with .Values.defaultBackend.autoscaling.targetMemoryUtilizationPercentage }} - type: Resource resource: name: memory + {{- if $.Capabilities.APIVersions.Has "autoscaling/v2beta2" }} target: type: Utilization averageUtilization: {{ . }} -{{- end }} + {{- else }} + targetAverageUtilization: {{ . }} + {{- end }} + {{- end }} + {{- if .Capabilities.APIVersions.Has "autoscaling/v2beta2" }} + {{- with .Values.defaultBackend.autoscaling.behaviour }} + behavior: + {{- toYaml . | nindent 4 }} + {{- end }} + {{- end }} {{- end }} diff --git a/charts/nginx-ingress/values.yaml b/charts/nginx-ingress/values.yaml index f5740bb2e6..c9e45accc5 100644 --- a/charts/nginx-ingress/values.yaml +++ b/charts/nginx-ingress/values.yaml @@ -810,6 +810,7 @@ defaultBackend: maxReplicas: 2 targetCPUUtilizationPercentage: 50 targetMemoryUtilizationPercentage: 50 + behaviour: {} service: annotations: {} diff --git a/charts/registry/templates/hpa.yaml b/charts/registry/templates/hpa.yaml index 35b7a419aa..27259ca0ae 100644 --- a/charts/registry/templates/hpa.yaml +++ b/charts/registry/templates/hpa.yaml @@ -1,5 +1,10 @@ {{- if .Values.enabled -}} +--- +{{- if .Capabilities.APIVersions.Has "autoscaling/v2beta2" }} apiVersion: autoscaling/v2beta2 +{{- else }} +apiVersion: autoscaling/v2beta1 +{{- end }} kind: HorizontalPodAutoscaler metadata: name: {{ template "registry.fullname" . }} @@ -19,17 +24,20 @@ spec: - type: Resource resource: name: cpu + {{- if .Capabilities.APIVersions.Has "autoscaling/v2beta2" }} target: type: Utilization averageUtilization: {{ .Values.hpa.cpu.targetAverageUtilization }} + {{- else }} + targetAverageUtilization: {{ .Values.hpa.cpu.targetAverageUtilization }} + {{- end }} {{- else -}} {{- toYaml .Values.hpa.customMetrics | nindent 4 -}} {{- end }} + {{- if .Capabilities.APIVersions.Has "autoscaling/v2beta2" }} + {{- with .Values.hpa.behaviour }} behavior: - {{- if not .Values.hpa.customBehavior }} - scaleDown: - stabilizationWindowSeconds: {{ .Values.hpa.scaleDownStabilizationWindowSeconds }} - {{- else }} - {{- toYaml .Values.hpa.customBehavior | nindent 4 -}} + {{- toYaml . | nindent 4 }} + {{- end }} {{- end }} {{- end -}} diff --git a/charts/registry/values.yaml b/charts/registry/values.yaml index 46d1c52884..797df31ebb 100644 --- a/charts/registry/values.yaml +++ b/charts/registry/values.yaml @@ -224,11 +224,11 @@ hpa: maxReplicas: 10 cpu: targetAverageUtilization: 75 - scaleDownStabilizationWindowSeconds: 300 - - # Note that the HPA is limited to autoscaling/v2beta2. - customMetrics: [] # Overrides targetAverageUtilization - customBehavior: {} # Overrides scaleDownStabilizationWindowSeconds + # Note that the HPA is limited to autoscaling/v2beta1 and autoscaling/v2beta2 + customMetrics: [] # Overrides HPA metrics definition + behaviour: + scaleDown: + stabilizationWindowSeconds: 300 storage: {} # secret: diff --git a/doc/charts/gitlab/gitlab-pages/index.md b/doc/charts/gitlab/gitlab-pages/index.md index dca8a4edb6..3cdc6d5377 100644 --- a/doc/charts/gitlab/gitlab-pages/index.md +++ b/doc/charts/gitlab/gitlab-pages/index.md @@ -33,43 +33,48 @@ configurations that can be supplied to the `helm install` command using the ### General settings -| Parameter | Default | Description | -| ----------------------------------------- | ---------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `annotations` | | Pod annotations | -| `common.labels` | `{}` | Supplemental labels that are applied to all objects created by this chart. | -| `deployment.strategy` | `{}` | Allows one to configure the update strategy used by the deployment. When not provided, the cluster default is used. | -| `extraEnv` | | List of extra environment variables to expose | -| `extraEnvFrom` | | List of extra environment variables from other data source to expose | -| `image.pullPolicy` | `IfNotPresent` | GitLab image pull policy | -| `image.pullSecrets` | | Secrets for the image repository | -| `image.repository` | `registry.gitlab.com/gitlab-org/build/cng/gitlab-exporter` | GitLab Exporter image repository | -| `image.tag` | | image tag | -| `init.image.repository` | | initContainer image | -| `init.image.tag` | | initContainer image tag | -| `metrics.enabled` | `true` | If a metrics endpoint should be made available for scraping | -| `metrics.port` | `9235` | Metrics endpoint port | -| `metrics.path` | `/metrics` | Metrics endpoint path | -| `metrics.serviceMonitor.enabled` | `false` | If a ServiceMonitor should be created to enable Prometheus Operator to manage the metrics scraping, note that enabling this removes the `prometheus.io` scrape annotations | -| `metrics.serviceMonitor.additionalLabels` | `{}` | Additional labels to add to the ServiceMonitor | -| `metrics.serviceMonitor.endpointConfig` | `{}` | Additional endpoint configuration for the ServiceMonitor | -| `metrics.annotations` | | **DEPRECATED** Set explicit metrics annotations. Replaced by template content. | -| `podLabels` | | Supplemental Pod labels. Will not be used for selectors. | -| `resources.requests.cpu` | `75m` | GitLab Pages minimum CPU | -| `resources.requests.memory` | `100M` | GitLab Pages minimum memory | -| `securityContext.fsGroup` | `1000` | Group ID under which the pod should be started | -| `securityContext.runAsUser` | `1000` | User ID under which the pod should be started | -| `service.externalPort` | `8090` | GitLab Pages exposed port | -| `service.internalPort` | `8090` | GitLab Pages internal port | -| `service.name` | `gitlab-pages` | GitLab Pages service name | -| `service.customDomains.type` | `LoadBalancer` | Type of service created for handling custom domains | -| `service.customDomains.internalHttpsPort` | `8091` | Port where Pages daemon listens for HTTPS requests | -| `service.customDomains.internalHttpsPort` | `8091` | Port where Pages daemon listens for HTTPS requests | -| `service.customDomains.nodePort.http` | | Node Port to be opened for HTTP connections. Valid only if `service.customDomains.type` is `NodePort` | -| `service.customDomains.nodePort.https` | | Node Port to be opened for HTTPS connections. Valid only if `service.customDomains.type` is `NodePort` | -| `service.sessionAffinity` | `None` | Type of the session affinity. Must be either `ClientIP` or `None` (this only makes sense for traffic originating from within the cluster) | -| `service.sessionAffinityConfig` | | Session affinity config. If `service.sessionAffinity` == `ClientIP` the default session sticky time is 3 hours (10800) | -| `serviceLabels` | `{}` | Supplemental service labels | -| `tolerations` | `[]` | Toleration labels for pod assignment | +| Parameter | Default | Description | +| ----------------------------------------- | ---------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `annotations` | | Pod annotations | +| `common.labels` | `{}` | Supplemental labels that are applied to all objects created by this chart. | +| `deployment.strategy` | `{}` | Allows one to configure the update strategy used by the deployment. When not provided, the cluster default is used. | +| `extraEnv` | | List of extra environment variables to expose | +| `extraEnvFrom` | | List of extra environment variables from other data source to expose | +| `hpa.behaviour` | `{scaleDown: {stabilizationWindowSeconds: 300 }}` | Behavior contains the specifications for up- and downscaling behavior (requires `autoscaling/v2beta2` or higher) | +| `hpa.customMetrics` | `[]` | Custom metrics contains the specifications for which to use to calculate the desired replica count (overrides the default use of Average CPU Utilization configured in `targetAverageUtilization`) | +| `hpa.targetAverageValue` | `100m` | Set the autoscaling target value | +| `hpa.minReplicas` | `1` | Minimum number of replicas | +| `hpa.maxReplicas` | `10` | Maximum number of replicas | +| `image.pullPolicy` | `IfNotPresent` | GitLab image pull policy | +| `image.pullSecrets` | | Secrets for the image repository | +| `image.repository` | `registry.gitlab.com/gitlab-org/build/cng/gitlab-exporter` | GitLab Exporter image repository | +| `image.tag` | | image tag | +| `init.image.repository` | | initContainer image | +| `init.image.tag` | | initContainer image tag | +| `metrics.enabled` | `true` | If a metrics endpoint should be made available for scraping | +| `metrics.port` | `9235` | Metrics endpoint port | +| `metrics.path` | `/metrics` | Metrics endpoint path | +| `metrics.serviceMonitor.enabled` | `false` | If a ServiceMonitor should be created to enable Prometheus Operator to manage the metrics scraping, note that enabling this removes the `prometheus.io` scrape annotations | +| `metrics.serviceMonitor.additionalLabels` | `{}` | Additional labels to add to the ServiceMonitor | +| `metrics.serviceMonitor.endpointConfig` | `{}` | Additional endpoint configuration for the ServiceMonitor | +| `metrics.annotations` | | **DEPRECATED** Set explicit metrics annotations. Replaced by template content. | +| `podLabels` | | Supplemental Pod labels. Will not be used for selectors. | +| `resources.requests.cpu` | `75m` | GitLab Pages minimum CPU | +| `resources.requests.memory` | `100M` | GitLab Pages minimum memory | +| `securityContext.fsGroup` | `1000` | Group ID under which the pod should be started | +| `securityContext.runAsUser` | `1000` | User ID under which the pod should be started | +| `service.externalPort` | `8090` | GitLab Pages exposed port | +| `service.internalPort` | `8090` | GitLab Pages internal port | +| `service.name` | `gitlab-pages` | GitLab Pages service name | +| `service.customDomains.type` | `LoadBalancer` | Type of service created for handling custom domains | +| `service.customDomains.internalHttpsPort` | `8091` | Port where Pages daemon listens for HTTPS requests | +| `service.customDomains.internalHttpsPort` | `8091` | Port where Pages daemon listens for HTTPS requests | +| `service.customDomains.nodePort.http` | | Node Port to be opened for HTTP connections. Valid only if `service.customDomains.type` is `NodePort` | +| `service.customDomains.nodePort.https` | | Node Port to be opened for HTTPS connections. Valid only if `service.customDomains.type` is `NodePort` | +| `service.sessionAffinity` | `None` | Type of the session affinity. Must be either `ClientIP` or `None` (this only makes sense for traffic originating from within the cluster) | +| `service.sessionAffinityConfig` | | Session affinity config. If `service.sessionAffinity` == `ClientIP` the default session sticky time is 3 hours (10800) | +| `serviceLabels` | `{}` | Supplemental service labels | +| `tolerations` | `[]` | Toleration labels for pod assignment | ### Pages specific settings diff --git a/doc/charts/gitlab/gitlab-shell/index.md b/doc/charts/gitlab/gitlab-shell/index.md index 49b91dde15..d27702f003 100644 --- a/doc/charts/gitlab/gitlab-shell/index.md +++ b/doc/charts/gitlab/gitlab-shell/index.md @@ -30,72 +30,72 @@ controlled by `global.shell.port`. ## Installation command line options -| Parameter | Default | Description | -| ----------------------------------------------- | ------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `annotations` | | Pod annotations | -| `podLabels` | | Supplemental Pod labels. Will not be used for selectors. | -| `common.labels` | | Supplemental labels that are applied to all objects created by this chart. | -| `config.clientAliveInterval` | `0` | Interval between keepalive pings on otherwise idle connections; the default value of 0 disables this ping | -| `config.loginGraceTime` | `60` | Specifies amount of time that the server will disconnect after if the user has not successfully logged in | -| `config.maxStartups.full` | `100` | SSHd refuse probability will increase linearly and all unauthenticated connection attempts would be refused when unauthenticated connections number will reach specified number | -| `config.maxStartups.rate` | `30` | SSHd will refuse connections with specified probability when there would be too many unauthenticated connections (optional) | -| `config.maxStartups.start` | `10` | SSHd will refuse connection attempts with some probability if there are currently more than the specified number of unauthenticated connections (optional) | -| `config.proxyProtocol` | `false` | Enable PROXY protocol support for the `gitlab-sshd` daemon | -| `config.proxyPolicy` | `"use"` | Specify policy for handling PROXY protocol. Value must be one of `use, require, ignore, reject` | -| `config.proxyHeaderTimeout` | `"500ms"` | The maximum duration `gitlab-sshd` will wait before giving up on reading the PROXY protocol header. Must include units: `ms`, `s`, or `m`. | -| `config.ciphers` | `[aes128-gcm@openssh.com, chacha20-poly1305@openssh.com, aes256-gcm@openssh.com, aes128-ctr, aes192-ctr, aes256-ctr]` | Specify the ciphers allowed. | -| `config.kexAlgorithms` | `[curve25519-sha256, curve25519-sha256@libssh.org, ecdh-sha2-nistp256, ecdh-sha2-nistp384, ecdh-sha2-nistp521, diffie-hellman-group14-sha256, diffie-hellman-group14-sha1]` | Specifies the available KEX (Key Exchange) algorithms. | -| `config.macs` | `[hmac-sha2-256-etm@openssh.com, hmac-sha2-512-etm@openssh.com, hmac-sha2-256, hmac-sha2-512, hmac-sha1]` | Specifies the available MAC (message authentication code algorithms. | -| `deployment.livenessProbe.initialDelaySeconds` | 10 | Delay before liveness probe is initiated | -| `deployment.livenessProbe.periodSeconds` | 10 | How often to perform the liveness probe | -| `deployment.livenessProbe.timeoutSeconds` | 3 | When the liveness probe times out | -| `deployment.livenessProbe.successThreshold` | 1 | Minimum consecutive successes for the liveness probe to be considered successful after having failed | -| `deployment.livenessProbe.failureThreshold` | 3 | Minimum consecutive failures for the liveness probe to be considered failed after having succeeded | -| `deployment.readinessProbe.initialDelaySeconds` | 10 | Delay before readiness probe is initiated | -| `deployment.readinessProbe.periodSeconds` | 5 | How often to perform the readiness probe | -| `deployment.readinessProbe.timeoutSeconds` | 3 | When the readiness probe times out | -| `deployment.readinessProbe.successThreshold` | 1 | Minimum consecutive successes for the readiness probe to be considered successful after having failed | -| `deployment.readinessProbe.failureThreshold` | 2 | Minimum consecutive failures for the readiness probe to be considered failed after having succeeded | -| `deployment.strategy` | `{}` | Allows one to configure the update strategy utilized by the deployment | -| `deployment.terminationGracePeriodSeconds` | 30 | Seconds that Kubernetes will wait for a pod to forcibly exit | -| `enabled` | `true` | Shell enable flag | -| `extraContainers` | | List of extra containers to include | -| `extraInitContainers` | | List of extra init containers to include | -| `extraVolumeMounts` | | List of extra volumes mounts to do | -| `extraVolumes` | | List of extra volumes to create | -| `extraEnv` | | List of extra environment variables to expose | -| `extraEnvFrom` | | List of extra environment variables from other data sources to expose | -| `hpa.scaleDownStabilizationWindowSeconds` | `300` | Set the scaledown stabilization window in seconds (max 3600) | -| `hpa.targetAverageValue` | `100m` | Set the autoscaling target value | -| `image.pullPolicy` | `IfNotPresent` | Shell image pull policy | -| `image.pullSecrets` | | Secrets for the image repository | -| `image.repository` | `registry.com/gitlab-org/build/cng/gitlab-shell` | Shell image repository | -| `image.tag` | `master` | Shell image tag | -| `init.image.repository` | | initContainer image | -| `init.image.tag` | | initContainer image tag | -| `logging.format` | `text` | Set to `json` for JSON-structured logs | -| `logging.sshdLogLevel` | `ERROR` | Log level for underlying SSH daemon | -| `replicaCount` | `1` | Shell replicas | -| `serviceLabels` | `{}` | Supplemental service labels | -| `service.externalTrafficPolicy` | `Cluster` | Shell service external traffic policy (Cluster or Local) | -| `service.internalPort` | `2222` | Shell internal port | -| `service.nodePort` | | Sets shell nodePort if set | -| `service.name` | `gitlab-shell` | Shell service name | -| `service.type` | `ClusterIP` | Shell service type | -| `service.loadBalancerIP` | | IP address to assign to LoadBalancer (if supported) | -| `service.loadBalancerSourceRanges` | | List of IP CIDRs allowed access to LoadBalancer (if supported) | -| `securityContext.fsGroup` | `1000` | Group ID under which the pod should be started | -| `securityContext.runAsUser` | `1000` | User ID under which the pod should be started | -| `sshDaemon` | `openssh` | Selects which SSH daemon would be run, possible values (`openssh`, `gitlab-sshd`) | -| `tolerations` | `[]` | Toleration labels for pod assignment | -| `workhorse.serviceName` | `webservice` | Workhorse service name (by default, Workhorse is a part of the webservice Pods / Service) | -| `metrics.enabled` | `false` | If a metrics endpoint should be made available for scraping | -| `metrics.port` | `9122` | Metrics endpoint port | -| `metrics.path` | `/metrics` | Metrics endpoint path | -| `metrics.serviceMonitor.enabled` | `false` | If a ServiceMonitor should be created to enable Prometheus Operator to manage the metrics scraping, note that enabling this removes the `prometheus.io` scrape annotations | -| `metrics.serviceMonitor.additionalLabels` | `{}` | Additional labels to add to the ServiceMonitor | -| `metrics.serviceMonitor.endpointConfig` | `{}` | Additional endpoint configuration for the ServiceMonitor | -| `metrics.annotations` | | **DEPRECATED** Set explicit metrics annotations. Replaced by template content. | +| Parameter | Default | Description | +| ----------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `annotations` | | Pod annotations | +| `podLabels` | | Supplemental Pod labels. Will not be used for selectors. | +| `common.labels` | | Supplemental labels that are applied to all objects created by this chart. | +| `config.clientAliveInterval` | `0` | Interval between keepalive pings on otherwise idle connections; the default value of 0 disables this ping | +| `config.loginGraceTime` | `60` | Specifies amount of time that the server will disconnect after if the user has not successfully logged in | +| `config.maxStartups.full` | `100` | SSHd refuse probability will increase linearly and all unauthenticated connection attempts would be refused when unauthenticated connections number will reach specified number | +| `config.maxStartups.rate` | `30` | SSHd will refuse connections with specified probability when there would be too many unauthenticated connections (optional) | +| `config.maxStartups.start` | `10` | SSHd will refuse connection attempts with some probability if there are currently more than the specified number of unauthenticated connections (optional) | +| `config.proxyProtocol` | `false` | Enable PROXY protocol support for the `gitlab-sshd` daemon | +| `config.proxyPolicy` | `"use"` | Specify policy for handling PROXY protocol. Value must be one of `use, require, ignore, reject` | +| `config.proxyHeaderTimeout` | `"500ms"` | The maximum duration `gitlab-sshd` will wait before giving up on reading the PROXY protocol header. Must include units: `ms`, `s`, or `m`. | +| `config.ciphers` | `[aes128-gcm@openssh.com, chacha20-poly1305@openssh.com, aes256-gcm@openssh.com, aes128-ctr, aes192-ctr, aes256-ctr]` | Specify the ciphers allowed. | +| `config.kexAlgorithms` | `[curve25519-sha256, curve25519-sha256@libssh.org, ecdh-sha2-nistp256, ecdh-sha2-nistp384, ecdh-sha2-nistp521, diffie-hellman-group14-sha256, diffie-hellman-group14-sha1]` | Specifies the available KEX (Key Exchange) algorithms. | +| `config.macs` | `[hmac-sha2-256-etm@openssh.com, hmac-sha2-512-etm@openssh.com, hmac-sha2-256, hmac-sha2-512, hmac-sha1]` | Specifies the available MAC (message authentication code algorithms. | +| `deployment.livenessProbe.initialDelaySeconds` | 10 | Delay before liveness probe is initiated | +| `deployment.livenessProbe.periodSeconds` | 10 | How often to perform the liveness probe | +| `deployment.livenessProbe.timeoutSeconds` | 3 | When the liveness probe times out | +| `deployment.livenessProbe.successThreshold` | 1 | Minimum consecutive successes for the liveness probe to be considered successful after having failed | +| `deployment.livenessProbe.failureThreshold` | 3 | Minimum consecutive failures for the liveness probe to be considered failed after having succeeded | +| `deployment.readinessProbe.initialDelaySeconds` | 10 | Delay before readiness probe is initiated | +| `deployment.readinessProbe.periodSeconds` | 5 | How often to perform the readiness probe | +| `deployment.readinessProbe.timeoutSeconds` | 3 | When the readiness probe times out | +| `deployment.readinessProbe.successThreshold` | 1 | Minimum consecutive successes for the readiness probe to be considered successful after having failed | +| `deployment.readinessProbe.failureThreshold` | 2 | Minimum consecutive failures for the readiness probe to be considered failed after having succeeded | +| `deployment.strategy` | `{}` | Allows one to configure the update strategy utilized by the deployment | +| `deployment.terminationGracePeriodSeconds` | 30 | Seconds that Kubernetes will wait for a pod to forcibly exit | +| `enabled` | `true` | Shell enable flag | +| `extraContainers` | | List of extra containers to include | +| `extraInitContainers` | | List of extra init containers to include | +| `extraVolumeMounts` | | List of extra volumes mounts to do | +| `extraVolumes` | | List of extra volumes to create | +| `extraEnv` | | List of extra environment variables to expose | +| `extraEnvFrom` | | List of extra environment variables from other data sources to expose | +| `hpa.behaviour` | `{scaleDown: {stabilizationWindowSeconds: 300 }}` | Behavior contains the specifications for up- and downscaling behavior (requires `autoscaling/v2beta2` or higher) | +| `hpa.targetAverageValue` | `100m` | Set the autoscaling target value | +| `image.pullPolicy` | `IfNotPresent` | Shell image pull policy | +| `image.pullSecrets` | | Secrets for the image repository | +| `image.repository` | `registry.com/gitlab-org/build/cng/gitlab-shell` | Shell image repository | +| `image.tag` | `master` | Shell image tag | +| `init.image.repository` | | initContainer image | +| `init.image.tag` | | initContainer image tag | +| `logging.format` | `text` | Set to `json` for JSON-structured logs | +| `logging.sshdLogLevel` | `ERROR` | Log level for underlying SSH daemon | +| `replicaCount` | `1` | Shell replicas | +| `serviceLabels` | `{}` | Supplemental service labels | +| `service.externalTrafficPolicy` | `Cluster` | Shell service external traffic policy (Cluster or Local) | +| `service.internalPort` | `2222` | Shell internal port | +| `service.nodePort` | | Sets shell nodePort if set | +| `service.name` | `gitlab-shell` | Shell service name | +| `service.type` | `ClusterIP` | Shell service type | +| `service.loadBalancerIP` | | IP address to assign to LoadBalancer (if supported) | +| `service.loadBalancerSourceRanges` | | List of IP CIDRs allowed access to LoadBalancer (if supported) | +| `securityContext.fsGroup` | `1000` | Group ID under which the pod should be started | +| `securityContext.runAsUser` | `1000` | User ID under which the pod should be started | +| `sshDaemon` | `openssh` | Selects which SSH daemon would be run, possible values (`openssh`, `gitlab-sshd`) | +| `tolerations` | `[]` | Toleration labels for pod assignment | +| `workhorse.serviceName` | `webservice` | Workhorse service name (by default, Workhorse is a part of the webservice Pods / Service) | +| `metrics.enabled` | `false` | If a metrics endpoint should be made available for scraping | +| `metrics.port` | `9122` | Metrics endpoint port | +| `metrics.path` | `/metrics` | Metrics endpoint path | +| `metrics.serviceMonitor.enabled` | `false` | If a ServiceMonitor should be created to enable Prometheus Operator to manage the metrics scraping, note that enabling this removes the `prometheus.io` scrape annotations | +| `metrics.serviceMonitor.additionalLabels` | `{}` | Additional labels to add to the ServiceMonitor | +| `metrics.serviceMonitor.endpointConfig` | `{}` | Additional endpoint configuration for the ServiceMonitor | +| `metrics.annotations` | | **DEPRECATED** Set explicit metrics annotations. Replaced by template content. | ## Chart configuration examples diff --git a/doc/charts/gitlab/kas/index.md b/doc/charts/gitlab/kas/index.md index c7ad30d99f..78599e030d 100644 --- a/doc/charts/gitlab/kas/index.md +++ b/doc/charts/gitlab/kas/index.md @@ -61,53 +61,53 @@ specified in `global.hosts.domain`. You can pass these parameters to the `helm install` command by using the `--set` flags. -| Parameter | Default | Description | -|---|---|---| -| `annotations` | `{}` | Pod annotations. | -| `common.labels` | `{}` | Supplemental labels that are applied to all objects created by this chart. | -| `extraContainers` | | List of extra containers to include. | -| `image.repository` | `registry.gitlab.com/gitlab-org/build/cng/gitlab-kas` | Image repository. | -| `image.tag` | `v13.7.0` | Image tag. | -| `hpa.scaleDownStabilizationWindowSeconds` | `300` | Set the scaledown stabilization window in seconds (max 3600) | -| `hpa.targetAverageValue` | `100m` | Set the autoscaling target value (CPU). | -| `ingress.enabled` | `true` if `global.kas.enabled=true` | You can use `kas.ingress.enabled` to explicitly turn it on or off. If not set, you can optionally use `global.ingress.enabled` for the same purpose. | -| `ingress.apiVersion` | | Value to use in the `apiVersion` field. | -| `ingress.annotations` | `{}` | Ingress annotations. | -| `ingress.tls` | `{}` | Ingress TLS configuration. | -| `ingress.agentPath` | `/` | Ingress path for the agent API endpoint. | -| `ingress.k8sApiPath` | `/k8s-proxy` | Ingress path for Kubernetes API endpoint. | -| `metrics.enabled` | `true` | If a metrics endpoint should be made available for scraping. | -| `metrics.port` | `8151` | Metrics endpoint port. | -| `metrics.path` | `/metrics` | Metrics endpoint path. | -| `metrics.serviceMonitor.enabled` | `false` | If a ServiceMonitor should be created to enable Prometheus Operator to manage the metrics scraping. Enabling removes the `prometheus.io` scrape annotations. | -| `metrics.serviceMonitor.additionalLabels` | `{}` | Additional labels to add to the ServiceMonitor. | -| `metrics.serviceMonitor.endpointConfig` | `{}` | Additional endpoint configuration for the ServiceMonitor. | -| `maxReplicas` | `10` | HPA `maxReplicas`. | -| `maxUnavailable` | `1` | HPA `maxUnavailable`. | -| `minReplicas` | `2` | HPA `maxReplicas`. | -| `nodeSelector` | | Define a [nodeSelector](https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#nodeselector) for the `Pod`s of this `Deployment`, if present. | -| `serviceAccount.annotations` | `{}` | Service account annotations. | -| `podLabels` | `{}` | Supplemental Pod labels. Not used for selectors. | -| `serviceLabels` | `{}` | Supplemental service labels. | -| `common.labels` | | Supplemental labels that are applied to all objects created by this chart. | -| `redis.enabled` | `true` | Allows opting-out of using Redis for KAS features. Warnings: Redis will become a hard dependency soon, so this key is already deprecated. | -| `resources.requests.cpu` | `75m` | GitLab Exporter minimum CPU. | -| `resources.requests.memory` | `100M` | GitLab Exporter minimum memory. | -| `service.externalPort` | `8150` | External port (for `agentk` connections). | -| `service.internalPort` | `8150` | Internal port (for `agentk` connections). | -| `service.apiInternalPort` | `8153` | Internal port for the internal API (for GitLab backend). | -| `service.loadBalancerIP` | `nil` | A custom load balancer IP when `service.type` is `LoadBalancer`. | -| `service.loadBalancerSourceRanges` | `nil` | A list of custom load balancer source ranges when `service.type` is `LoadBalancer`. | -| `service.kubernetesApiPort` | `8154` | External port to expose proxied Kubernetes API on. | -| `service.privateApiPort` | `8155` | Internal port to expose `kas`' private API on (for `kas` -> `kas` communication). | -| `privateApi.secret` | Autogenerated | The name of the secret to use for authenticating with the database. | -| `privateApi.key` | Autogenerated | The name of the key in `privateApi.secret` to use. | -| `global.kas.service.apiExternalPort` | `8153` | External port for the internal API (for GitLab backend). | -| `service.type` | `ClusterIP` | Service type. | -| `tolerations` | `[]` | Toleration labels for pod assignment. | -| `customConfig` | `{}` | When given, merges the default `kas` configuration with these values giving precedence to those defined here. | -| `deployment.minReadySeconds` | `0` | Minimum number of seconds that must pass before a `kas` pod is considered ready. | -| `deployment.strategy` | `{}` | Allows one to configure the update strategy utilized by the deployment. | +| Parameter | Default | Description | +| ----------------------------------------- | ----------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `annotations` | `{}` | Pod annotations. | +| `common.labels` | `{}` | Supplemental labels that are applied to all objects created by this chart. | +| `extraContainers` | | List of extra containers to include. | +| `image.repository` | `registry.gitlab.com/gitlab-org/build/cng/gitlab-kas` | Image repository. | +| `image.tag` | `v13.7.0` | Image tag. | +| `hpa.behaviour` | `{scaleDown: {stabilizationWindowSeconds: 300 }}` | Behavior contains the specifications for up- and downscaling behavior (requires `autoscaling/v2beta2` or higher) | +| `hpa.targetAverageValue` | `100m` | Set the autoscaling target value (CPU). | +| `ingress.enabled` | `true` if `global.kas.enabled=true` | You can use `kas.ingress.enabled` to explicitly turn it on or off. If not set, you can optionally use `global.ingress.enabled` for the same purpose. | +| `ingress.apiVersion` | | Value to use in the `apiVersion` field. | +| `ingress.annotations` | `{}` | Ingress annotations. | +| `ingress.tls` | `{}` | Ingress TLS configuration. | +| `ingress.agentPath` | `/` | Ingress path for the agent API endpoint. | +| `ingress.k8sApiPath` | `/k8s-proxy` | Ingress path for Kubernetes API endpoint. | +| `metrics.enabled` | `true` | If a metrics endpoint should be made available for scraping. | +| `metrics.port` | `8151` | Metrics endpoint port. | +| `metrics.path` | `/metrics` | Metrics endpoint path. | +| `metrics.serviceMonitor.enabled` | `false` | If a ServiceMonitor should be created to enable Prometheus Operator to manage the metrics scraping. Enabling removes the `prometheus.io` scrape annotations. | +| `metrics.serviceMonitor.additionalLabels` | `{}` | Additional labels to add to the ServiceMonitor. | +| `metrics.serviceMonitor.endpointConfig` | `{}` | Additional endpoint configuration for the ServiceMonitor. | +| `maxReplicas` | `10` | HPA `maxReplicas`. | +| `maxUnavailable` | `1` | HPA `maxUnavailable`. | +| `minReplicas` | `2` | HPA `maxReplicas`. | +| `nodeSelector` | | Define a [nodeSelector](https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#nodeselector) for the `Pod`s of this `Deployment`, if present. | +| `serviceAccount.annotations` | `{}` | Service account annotations. | +| `podLabels` | `{}` | Supplemental Pod labels. Not used for selectors. | +| `serviceLabels` | `{}` | Supplemental service labels. | +| `common.labels` | | Supplemental labels that are applied to all objects created by this chart. | +| `redis.enabled` | `true` | Allows opting-out of using Redis for KAS features. Warnings: Redis will become a hard dependency soon, so this key is already deprecated. | +| `resources.requests.cpu` | `75m` | GitLab Exporter minimum CPU. | +| `resources.requests.memory` | `100M` | GitLab Exporter minimum memory. | +| `service.externalPort` | `8150` | External port (for `agentk` connections). | +| `service.internalPort` | `8150` | Internal port (for `agentk` connections). | +| `service.apiInternalPort` | `8153` | Internal port for the internal API (for GitLab backend). | +| `service.loadBalancerIP` | `nil` | A custom load balancer IP when `service.type` is `LoadBalancer`. | +| `service.loadBalancerSourceRanges` | `nil` | A list of custom load balancer source ranges when `service.type` is `LoadBalancer`. | +| `service.kubernetesApiPort` | `8154` | External port to expose proxied Kubernetes API on. | +| `service.privateApiPort` | `8155` | Internal port to expose `kas`' private API on (for `kas` -> `kas` communication). | +| `privateApi.secret` | Autogenerated | The name of the secret to use for authenticating with the database. | +| `privateApi.key` | Autogenerated | The name of the key in `privateApi.secret` to use. | +| `global.kas.service.apiExternalPort` | `8153` | External port for the internal API (for GitLab backend). | +| `service.type` | `ClusterIP` | Service type. | +| `tolerations` | `[]` | Toleration labels for pod assignment. | +| `customConfig` | `{}` | When given, merges the default `kas` configuration with these values giving precedence to those defined here. | +| `deployment.minReadySeconds` | `0` | Minimum number of seconds that must pass before a `kas` pod is considered ready. | +| `deployment.strategy` | `{}` | Allows one to configure the update strategy utilized by the deployment. | ## Test the `kas` chart diff --git a/doc/charts/gitlab/mailroom/index.md b/doc/charts/gitlab/mailroom/index.md index e8b3703904..a51cb51b17 100644 --- a/doc/charts/gitlab/mailroom/index.md +++ b/doc/charts/gitlab/mailroom/index.md @@ -37,11 +37,10 @@ hpa: maxReplicas: 2 cpu: targetAverageUtilization: 75 - scaleDownStabilizationWindowSeconds: 300 - # Note that the HPA is limited to autoscaling/v2beta2 + # Note that the HPA is limited to autoscaling/v2beta1 and autoscaling/v2beta2 customMetrics: [] - customBehavior: {} + behavior: {} networkpolicy: enabled: false @@ -75,40 +74,39 @@ serviceAccount: # name: ``` -| Parameter | Description | Default | -|--------------------------------------|--------------------------------------------------|-----------------------------| -| `deployment.strategy` | Allows one to configure the update strategy utilized by the deployment | `{}` | -| `enabled` | Mailroom enablement flag | `true` | -| `hpa.minReplicas` | Minimum number of replicas | `1` | -| `hpa.maxReplicas` | Maximum number of replicas | `2` | -| `hpa.cpu.scaleDownStabilizationWindowSeconds` | Set the scaledown stabilization window in seconds (max 3600) | `300` | -| `hpa.cpu.targetAverageUtilization` | Target value of the average of the resource metric | `75` | -| `hpa.customBehavior` | autoscaling/v2beta2 Behavior contains the specifications for up- and downscaling behavior (overrides the default use of `scaleDownStabilizationWindowSeconds`) | `{}` | -| `hpa.customMetrics` | autoscaling/v2beta2 Metrics contains the specifications for which to use to calculate the desired replica count (overrides the default use of Average CPU Utilization configured in `targetAverageUtilization`) | `[]` | -| `image.pullPolicy` | Mailroom image pull policy | `IfNotPresent` | -| `extraEnvFrom` | List of extra environment variables from other data sources to expose| | -| `image.pullSecrets` | Mailroom image pull secrets | | -| `image.repository` | Mailroom image repository | `registry.gitlab.com/gitlab-org/build/cng/gitlab-mailroom` | -| `image.tag` | Mailroom image tag | `master` | -| `init.image.repository` | Mailroom init image repository | | -| `init.image.tag` | Mailroom init image tag | | -| `init.resources` | Mailroom init container resource requirements | `{ requests: { cpu: 50m }}` | -| `podLabels` | Labels for running Mailroom Pods | `{}` | -| `common.labels` | Supplemental labels that are applied to all objects created by this chart. | `{}` | -| `resources` | Mailroom resource requirements | `{ requests: { cpu: 50m, memory: 150M }}` | -| `networkpolicy.annotations` | Annotations to add to the NetworkPolicy | `{}` | -| `networkpolicy.egress.enabled` | Flag to enable egress rules of NetworkPolicy | `false` | -| `networkpolicy.egress.rules` | Define a list of egress rules for NetworkPolicy | `[]` | -| `networkpolicy.enabled` | Flag for using NetworkPolicy | `false` | -| `networkpolicy.ingress.enabled` | Flag to enable `ingress` rules of NetworkPolicy | `false` | -| `networkpolicy.ingress.rules` | Define a list of `ingress` rules for NetworkPolicy | `[]` | -| `securityContext.fsGroup` | Group ID under which the pod should be started | `1000` | -| `securityContext.runAsUser` | User ID under which the pod should be started | `1000` | -| `serviceAccount.annotations` | Annotations for ServiceAccount | `{}` | -| `serviceAccount.enabled` | Flag for using ServiceAccount | `false` | -| `serviceAccount.create` | Flag for creating a ServiceAccount | `false` | -| `serviceAccount.name` | Name of ServiceAccount to use | | -| `tolerations` | Tolerations to add to the Mailroom | | +| Parameter | Description | Default | +| -------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------- | +| `deployment.strategy` | Allows one to configure the update strategy utilized by the deployment | `{}` | +| `enabled` | Mailroom enablement flag | `true` | +| `hpa.behaviour` | Behavior contains the specifications for up- and downscaling behavior (requires `autoscaling/v2beta2` or higher) | `{scaleDown: {stabilizationWindowSeconds: 300 }}` +| `hpa.cpu.targetAverageUtilization` | Target value of the average of the resource metric | `75` | +| `hpa.customMetrics` | Custom metrics contains the specifications for which to use to calculate the desired replica count (overrides the default use of Average CPU Utilization configured in `targetAverageUtilization`) | `[]` | +| `hpa.maxReplicas` | Maximum number of replicas | `2` | +| `hpa.minReplicas` | Minimum number of replicas | `1` | +| `image.pullPolicy` | Mailroom image pull policy | `IfNotPresent` | +| `extraEnvFrom` | List of extra environment variables from other data sources to expose | | +| `image.pullSecrets` | Mailroom image pull secrets | | +| `image.repository` | Mailroom image repository | `registry.gitlab.com/gitlab-org/build/cng/gitlab-mailroom` | +| `image.tag` | Mailroom image tag | `master` | +| `init.image.repository` | Mailroom init image repository | | +| `init.image.tag` | Mailroom init image tag | | +| `init.resources` | Mailroom init container resource requirements | `{ requests: { cpu: 50m }}` | +| `podLabels` | Labels for running Mailroom Pods | `{}` | +| `common.labels` | Supplemental labels that are applied to all objects created by this chart. | `{}` | +| `resources` | Mailroom resource requirements | `{ requests: { cpu: 50m, memory: 150M }}` | +| `networkpolicy.annotations` | Annotations to add to the NetworkPolicy | `{}` | +| `networkpolicy.egress.enabled` | Flag to enable egress rules of NetworkPolicy | `false` | +| `networkpolicy.egress.rules` | Define a list of egress rules for NetworkPolicy | `[]` | +| `networkpolicy.enabled` | Flag for using NetworkPolicy | `false` | +| `networkpolicy.ingress.enabled` | Flag to enable `ingress` rules of NetworkPolicy | `false` | +| `networkpolicy.ingress.rules` | Define a list of `ingress` rules for NetworkPolicy | `[]` | +| `securityContext.fsGroup` | Group ID under which the pod should be started | `1000` | +| `securityContext.runAsUser` | User ID under which the pod should be started | `1000` | +| `serviceAccount.annotations` | Annotations for ServiceAccount | `{}` | +| `serviceAccount.enabled` | Flag for using ServiceAccount | `false` | +| `serviceAccount.create` | Flag for creating a ServiceAccount | `false` | +| `serviceAccount.name` | Name of ServiceAccount to use | | +| `tolerations` | Tolerations to add to the Mailroom | | ## Incoming email diff --git a/doc/charts/gitlab/sidekiq/index.md b/doc/charts/gitlab/sidekiq/index.md index 16f20ce598..597c2e72fc 100644 --- a/doc/charts/gitlab/sidekiq/index.md +++ b/doc/charts/gitlab/sidekiq/index.md @@ -37,70 +37,70 @@ The `sidekiq` chart is configured in three parts: chart-wide [external services] The table below contains all the possible charts configurations that can be supplied to the `helm install` command using the `--set` flags: -| Parameter | Default | Description | -| ------------------------------------------ | ------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------- | -| `annotations` | | Pod annotations | -| `podLabels` | | Supplemental Pod labels. Will not be used for selectors. | -| `common.labels` | | Supplemental labels that are applied to all objects created by this chart. | -| `concurrency` | `25` | Sidekiq default concurrency | -| `deployment.strategy` | `{}` | Allows one to configure the update strategy utilized by the deployment | -| `deployment.terminationGracePeriodSeconds` | `30` | Optional duration in seconds the pod needs to terminate gracefully. | -| `enabled` | `true` | Sidekiq enabled flag | -| `extraContainers` | | List of extra containers to include | -| `extraInitContainers` | | List of extra init containers to include | -| `extraVolumeMounts` | | String template of extra volume mounts to configure | -| `extraVolumes` | | String template of extra volumes to configure | -| `extraEnv` | | List of extra environment variables to expose | -| `extraEnvFrom` | | List of extra environment variables from other data sources to expose | -| `gitaly.serviceName` | `gitaly` | Gitaly service name | -| `health_checks.port` | `3808` | Health check server port | -| `hpa.scaleDownStabilizationWindowSeconds` | `300` | | Set the scaledown stabilization window in seconds (max 3600) | -| `hpa.targetAverageValue` | `350m` | Set the autoscaling target value | -| `minReplicas` | `2` | Minimum number of replicas | -| `maxReplicas` | `10` | Maximum number of replicas | -| `maxUnavailable` | `1` | Limit of maximum number of Pods to be unavailable | -| `image.pullPolicy` | `Always` | Sidekiq image pull policy | -| `image.pullSecrets` | | Secrets for the image repository | -| `image.repository` | `registry.gitlab.com/gitlab-org/build/cng/gitlab-sidekiq-ee` | Sidekiq image repository | -| `image.tag` | | Sidekiq image tag | -| `init.image.repository` | | initContainer image | -| `init.image.tag` | | initContainer image tag | -| `logging.format` | `default` | Set to `json` for JSON-structured logs | -| `metrics.enabled` | `true` | If a metrics endpoint should be made available for scraping | -| `metrics.port` | `3807` | Metrics endpoint port | -| `metrics.path` | `/metrics` | Metrics endpoint path | -| `metrics.podMonitor.enabled` | `false` | If a PodMonitor should be created to enable Prometheus Operator to manage the metrics scraping | -| `metrics.podMonitor.additionalLabels` | `{}` | Additional labels to add to the PodMonitor | -| `metrics.podMonitor.endpointConfig` | `{}` | Additional endpoint configuration for the PodMonitor | -| `metrics.annotations` | | **DEPRECATED** Set explicit metrics annotations. Replaced by template content. | -| `psql.password.key` | `psql-password` | key to psql password in psql secret | -| `psql.password.secret` | `gitlab-postgres` | psql password secret | -| `psql.port` | | Set PostgreSQL server port. Takes precedence over `global.psql.port` | -| `redis.serviceName` | `redis` | Redis service name | -| `resources.requests.cpu` | `900m` | Sidekiq minimum needed CPU | -| `resources.requests.memory` | `2G` | Sidekiq minimum needed memory | -| `resources.limits.memory` | | Sidekiq maximum allowed memory | -| `timeout` | `25` | Sidekiq job timeout | -| `tolerations` | `[]` | Toleration labels for pod assignment | -| `memoryKiller.daemonMode` | `true` | If `false`, uses the legacy memory killer mode | -| `memoryKiller.maxRss` | `2000000` | Maximum RSS before delayed shutdown triggered expressed in kilobytes | -| `memoryKiller.graceTime` | `900` | Time to wait before a triggered shutdown expressed in seconds | -| `memoryKiller.shutdownWait` | `30` | Amount of time after triggered shutdown for existing jobs to finish expressed in seconds | -| `memoryKiller.hardLimitRss` | | Maximum RSS before immediate shutdown triggered expressed in kilobyte in daemon mode | -| `memoryKiller.checkInterval` | `3` | Amount of time between memory checks | -| `livenessProbe.initialDelaySeconds` | 20 | Delay before liveness probe is initiated | -| `livenessProbe.periodSeconds` | 60 | How often to perform the liveness probe | -| `livenessProbe.timeoutSeconds` | 30 | When the liveness probe times out | -| `livenessProbe.successThreshold` | 1 | Minimum consecutive successes for the liveness probe to be considered successful after having failed | -| `livenessProbe.failureThreshold` | 3 | Minimum consecutive failures for the liveness probe to be considered failed after having succeeded | -| `readinessProbe.initialDelaySeconds` | 0 | Delay before readiness probe is initiated | -| `readinessProbe.periodSeconds` | 10 | How often to perform the readiness probe | -| `readinessProbe.timeoutSeconds` | 2 | When the readiness probe times out | -| `readinessProbe.successThreshold` | 1 | Minimum consecutive successes for the readiness probe to be considered successful after having failed | -| `readinessProbe.failureThreshold` | 3 | Minimum consecutive failures for the readiness probe to be considered failed after having succeeded | -| `securityContext.fsGroup` | `1000` | Group ID under which the pod should be started | -| `securityContext.runAsUser` | `1000` | User ID under which the pod should be started | -| `priorityClassName` | `""` | Allow configuring pods `priorityClassName`, this is used to control pod priority in case of eviction | +| Parameter | Default | Description | +| ------------------------------------------ | ------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------- | +| `annotations` | | Pod annotations | +| `podLabels` | | Supplemental Pod labels. Will not be used for selectors. | +| `common.labels` | | Supplemental labels that are applied to all objects created by this chart. | +| `concurrency` | `25` | Sidekiq default concurrency | +| `deployment.strategy` | `{}` | Allows one to configure the update strategy utilized by the deployment | +| `deployment.terminationGracePeriodSeconds` | `30` | Optional duration in seconds the pod needs to terminate gracefully. | +| `enabled` | `true` | Sidekiq enabled flag | +| `extraContainers` | | List of extra containers to include | +| `extraInitContainers` | | List of extra init containers to include | +| `extraVolumeMounts` | | String template of extra volume mounts to configure | +| `extraVolumes` | | String template of extra volumes to configure | +| `extraEnv` | | List of extra environment variables to expose | +| `extraEnvFrom` | | List of extra environment variables from other data sources to expose | +| `gitaly.serviceName` | `gitaly` | Gitaly service name | +| `health_checks.port` | `3808` | Health check server port | +| `hpa.behaviour` | `{scaleDown: {stabilizationWindowSeconds: 300 }}` | Behavior contains the specifications for up- and downscaling behavior (requires `autoscaling/v2beta2` or higher) | +| `hpa.targetAverageValue` | `350m` | Set the autoscaling target value | +| `minReplicas` | `2` | Minimum number of replicas | +| `maxReplicas` | `10` | Maximum number of replicas | +| `maxUnavailable` | `1` | Limit of maximum number of Pods to be unavailable | +| `image.pullPolicy` | `Always` | Sidekiq image pull policy | +| `image.pullSecrets` | | Secrets for the image repository | +| `image.repository` | `registry.gitlab.com/gitlab-org/build/cng/gitlab-sidekiq-ee` | Sidekiq image repository | +| `image.tag` | | Sidekiq image tag | +| `init.image.repository` | | initContainer image | +| `init.image.tag` | | initContainer image tag | +| `logging.format` | `default` | Set to `json` for JSON-structured logs | +| `metrics.enabled` | `true` | If a metrics endpoint should be made available for scraping | +| `metrics.port` | `3807` | Metrics endpoint port | +| `metrics.path` | `/metrics` | Metrics endpoint path | +| `metrics.podMonitor.enabled` | `false` | If a PodMonitor should be created to enable Prometheus Operator to manage the metrics scraping | +| `metrics.podMonitor.additionalLabels` | `{}` | Additional labels to add to the PodMonitor | +| `metrics.podMonitor.endpointConfig` | `{}` | Additional endpoint configuration for the PodMonitor | +| `metrics.annotations` | | **DEPRECATED** Set explicit metrics annotations. Replaced by template content. | +| `psql.password.key` | `psql-password` | key to psql password in psql secret | +| `psql.password.secret` | `gitlab-postgres` | psql password secret | +| `psql.port` | | Set PostgreSQL server port. Takes precedence over `global.psql.port` | +| `redis.serviceName` | `redis` | Redis service name | +| `resources.requests.cpu` | `900m` | Sidekiq minimum needed CPU | +| `resources.requests.memory` | `2G` | Sidekiq minimum needed memory | +| `resources.limits.memory` | | Sidekiq maximum allowed memory | +| `timeout` | `25` | Sidekiq job timeout | +| `tolerations` | `[]` | Toleration labels for pod assignment | +| `memoryKiller.daemonMode` | `true` | If `false`, uses the legacy memory killer mode | +| `memoryKiller.maxRss` | `2000000` | Maximum RSS before delayed shutdown triggered expressed in kilobytes | +| `memoryKiller.graceTime` | `900` | Time to wait before a triggered shutdown expressed in seconds | +| `memoryKiller.shutdownWait` | `30` | Amount of time after triggered shutdown for existing jobs to finish expressed in seconds | +| `memoryKiller.hardLimitRss` | | Maximum RSS before immediate shutdown triggered expressed in kilobyte in daemon mode | +| `memoryKiller.checkInterval` | `3` | Amount of time between memory checks | +| `livenessProbe.initialDelaySeconds` | 20 | Delay before liveness probe is initiated | +| `livenessProbe.periodSeconds` | 60 | How often to perform the liveness probe | +| `livenessProbe.timeoutSeconds` | 30 | When the liveness probe times out | +| `livenessProbe.successThreshold` | 1 | Minimum consecutive successes for the liveness probe to be considered successful after having failed | +| `livenessProbe.failureThreshold` | 3 | Minimum consecutive failures for the liveness probe to be considered failed after having succeeded | +| `readinessProbe.initialDelaySeconds` | 0 | Delay before readiness probe is initiated | +| `readinessProbe.periodSeconds` | 10 | How often to perform the readiness probe | +| `readinessProbe.timeoutSeconds` | 2 | When the readiness probe times out | +| `readinessProbe.successThreshold` | 1 | Minimum consecutive successes for the readiness probe to be considered successful after having failed | +| `readinessProbe.failureThreshold` | 3 | Minimum consecutive failures for the readiness probe to be considered failed after having succeeded | +| `securityContext.fsGroup` | `1000` | Group ID under which the pod should be started | +| `securityContext.runAsUser` | `1000` | User ID under which the pod should be started | +| `priorityClassName` | `""` | Allow configuring pods `priorityClassName`, this is used to control pod priority in case of eviction | ## Chart configuration examples diff --git a/doc/charts/gitlab/spamcheck/index.md b/doc/charts/gitlab/spamcheck/index.md index dd5ddf8c43..30ade1f346 100644 --- a/doc/charts/gitlab/spamcheck/index.md +++ b/doc/charts/gitlab/spamcheck/index.md @@ -41,45 +41,45 @@ helm upgrade --force --install gitlab . \ The table below contains all the possible charts configurations that can be supplied to the `helm install` command using the `--set` flags. -| Parameter | Default | Description | -| --------------------------- | -------------- | ---------------------------------| -| `annotations` | `{}` | Pod annotations | -| `common.labels` | `{}` | Supplemental labels that are applied to all objects created by this chart. | -| `deployment.livenessProbe.initialDelaySeconds` | 20 | Delay before liveness probe is initiated | -| `deployment.livenessProbe.periodSeconds` | 60 | How often to perform the liveness probe | -| `deployment.livenessProbe.timeoutSeconds` | 30 | When the liveness probe times out | -| `deployment.livenessProbe.successThreshold` | 1 | Minimum consecutive successes for the liveness probe to be considered successful after having failed | -| `deployment.livenessProbe.failureThreshold` | 3 | Minimum consecutive failures for the liveness probe to be considered failed after having succeeded | -| `deployment.readinessProbe.initialDelaySeconds` | 0 | Delay before readiness probe is initiated | -| `deployment.readinessProbe.periodSeconds` | 10 | How often to perform the readiness probe | -| `deployment.readinessProbe.timeoutSeconds` | 2 | When the readiness probe times out | -| `deployment.readinessProbe.successThreshold` | 1 | Minimum consecutive successes for the readiness probe to be considered successful after having failed | -| `deployment.readinessProbe.failureThreshold` | 3 | Minimum consecutive failures for the readiness probe to be considered failed after having succeeded | -| `deployment.strategy` | `{}` | Allows one to configure the update strategy used by the deployment. When not provided, the cluster default is used. | -| `hpa.scaleDownStabilizationWindowSeconds` | `300` | Set the scaledown stabilization window in seconds (max 3600) | -| `hpa.targetAverageValue` | `100m` | Set the autoscaling target value (CPU) | -| `image.repository` | `registry.gitlab.com/gitlab-com/gl-security/engineering-and-research/automation-team/spam/spamcheck` | Spamcheck image repository | -| `logging.format` | `json` | Log format | -| `logging.level` | `info` | Log level | -| `metrics.enabled` | `true` | Toggle Prometheus metrics exporter | -| `metrics.port` | `8003` | Port number to use for the metrics exporter | -| `metrics.path` | `/metrics` | Path to use for the metrics exporter | -| `maxReplicas` | `10` | HPA `maxReplicas` | -| `maxUnavailable` | `1` | HPA `maxUnavailable` | -| `minReplicas` | `2` | HPA `maxReplicas` | -| `podLabels` | `{}` | Supplemental Pod labels. Not used for selectors. | -| `resources.requests.cpu` | `100m` | Spamcheck minimum CPU | -| `resources.requests.memory` | `100M` | Spamcheck minimum memory | -| `securityContext.fsGroup` | `1000` | Group ID under which the pod should be started | -| `securityContext.runAsUser` | `1000` | User ID under which the pod should be started | -| `serviceLabels` | `{}` | Supplemental service labels | -| `service.externalPort` | `8001` | Spamcheck external port | -| `service.internalPort` | `8001` | Spamcheck internal port | -| `service.type` | `ClusterIP` | Spamcheck service type | -| `serviceAccount.enabled` | Flag for using ServiceAccount | `false` | -| `serviceAccount.create` | Flag for creating a ServiceAccount | `false` | -| `tolerations` | `[]` | Toleration labels for pod assignment | -| `extraEnvFrom` | `{}`|List of extra environment variables from other data sources to expose| +| Parameter | Default | Description | +| ----------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------- | +| `annotations` | `{}` | Pod annotations | +| `common.labels` | `{}` | Supplemental labels that are applied to all objects created by this chart. | +| `deployment.livenessProbe.initialDelaySeconds` | 20 | Delay before liveness probe is initiated | +| `deployment.livenessProbe.periodSeconds` | 60 | How often to perform the liveness probe | +| `deployment.livenessProbe.timeoutSeconds` | 30 | When the liveness probe times out | +| `deployment.livenessProbe.successThreshold` | 1 | Minimum consecutive successes for the liveness probe to be considered successful after having failed | +| `deployment.livenessProbe.failureThreshold` | 3 | Minimum consecutive failures for the liveness probe to be considered failed after having succeeded | +| `deployment.readinessProbe.initialDelaySeconds` | 0 | Delay before readiness probe is initiated | +| `deployment.readinessProbe.periodSeconds` | 10 | How often to perform the readiness probe | +| `deployment.readinessProbe.timeoutSeconds` | 2 | When the readiness probe times out | +| `deployment.readinessProbe.successThreshold` | 1 | Minimum consecutive successes for the readiness probe to be considered successful after having failed | +| `deployment.readinessProbe.failureThreshold` | 3 | Minimum consecutive failures for the readiness probe to be considered failed after having succeeded | +| `deployment.strategy` | `{}` | Allows one to configure the update strategy used by the deployment. When not provided, the cluster default is used. | +| `hpa.behaviour` | `{scaleDown: {stabilizationWindowSeconds: 300 }}` | Behavior contains the specifications for up- and downscaling behavior (requires `autoscaling/v2beta2` or higher) | +| `hpa.targetAverageValue` | `100m` | Set the autoscaling target value (CPU) | +| `image.repository` | `registry.gitlab.com/gitlab-com/gl-security/engineering-and-research/automation-team/spam/spamcheck` | Spamcheck image repository | +| `logging.format` | `json` | Log format | +| `logging.level` | `info` | Log level | +| `metrics.enabled` | `true` | Toggle Prometheus metrics exporter | +| `metrics.port` | `8003` | Port number to use for the metrics exporter | +| `metrics.path` | `/metrics` | Path to use for the metrics exporter | +| `maxReplicas` | `10` | HPA `maxReplicas` | +| `maxUnavailable` | `1` | HPA `maxUnavailable` | +| `minReplicas` | `2` | HPA `maxReplicas` | +| `podLabels` | `{}` | Supplemental Pod labels. Not used for selectors. | +| `resources.requests.cpu` | `100m` | Spamcheck minimum CPU | +| `resources.requests.memory` | `100M` | Spamcheck minimum memory | +| `securityContext.fsGroup` | `1000` | Group ID under which the pod should be started | +| `securityContext.runAsUser` | `1000` | User ID under which the pod should be started | +| `serviceLabels` | `{}` | Supplemental service labels | +| `service.externalPort` | `8001` | Spamcheck external port | +| `service.internalPort` | `8001` | Spamcheck internal port | +| `service.type` | `ClusterIP` | Spamcheck service type | +| `serviceAccount.enabled` | Flag for using ServiceAccount | `false` | +| `serviceAccount.create` | Flag for creating a ServiceAccount | `false` | +| `tolerations` | `[]` | Toleration labels for pod assignment | +| `extraEnvFrom` | `{}` | List of extra environment variables from other data sources to expose | ## Chart configuration examples diff --git a/doc/charts/gitlab/webservice/index.md b/doc/charts/gitlab/webservice/index.md index d12f0db361..41291b7d27 100644 --- a/doc/charts/gitlab/webservice/index.md +++ b/doc/charts/gitlab/webservice/index.md @@ -53,10 +53,10 @@ to the `helm install` command using the `--set` flags. | `extraVolumeMounts` | | List of extra volumes mounts to do | | `extraVolumes` | | List of extra volumes to create | | `extraEnv` | | List of extra environment variables to expose | -| `extraEnvFrom` | | List of extra environment variables from other data sources to expose | +| `extraEnvFrom` | | List of extra environment variables from other data sources to expose | | `gitlab.webservice.workhorse.image` | `registry.gitlab.com/gitlab-org/build/cng/gitlab-workhorse-ee` | Workhorse image repository | | `gitlab.webservice.workhorse.tag` | | Workhorse image tag | -| `hpa.scaleDownStabilizationWindowSeconds` | `300` | Set the scaledown stabilization window in seconds (max 3600) | +| `hpa.behaviour` | `{scaleDown: {stabilizationWindowSeconds: 300 }}` | Behavior contains the specifications for up- and downscaling behavior (requires `autoscaling/v2beta2` or higher) | | `hpa.targetAverageValue` | `1` | Set the autoscaling target value | | `sshHostKeys.mount` | `false` | Whether to mount the GitLab Shell secret containing the public SSH keys. | | `sshHostKeys.mountName` | `ssh-host-keys` | Name of the mounted volume. | @@ -87,7 +87,7 @@ to the `helm install` command using the `--set` flags. | `puma.workerMaxMemory` | | The maximum memory (in megabytes) for the Puma worker killer | | `puma.threads.min` | `4` | The minimum amount of Puma threads | | `puma.threads.max` | `4` | The maximum amount of Puma threads | -| `rack_attack.git_basic_auth` | `{}` | See [GitLab documentation](https://docs.gitlab.com/ee/user/admin_area/settings/protected_paths.html) for details | +| `rack_attack.git_basic_auth` | `{}` | See [GitLab documentation](https://docs.gitlab.com/ee/user/admin_area/settings/protected_paths.html) for details | | `redis.serviceName` | `redis` | Redis service name | | `registry.api.port` | `5000` | Registry port | | `registry.api.protocol` | `http` | Registry protocol | diff --git a/doc/charts/registry/index.md b/doc/charts/registry/index.md index e16ee51e90..8801d85218 100644 --- a/doc/charts/registry/index.md +++ b/doc/charts/registry/index.md @@ -90,7 +90,9 @@ registry: maxReplicas: 10 cpu: targetAverageUtilization: 75 - scaleDownStabilizationWindowSeconds: 300 + behaviour: + scaleDown: + stabilizationWindowSeconds: 300 storage: secret: key: storage @@ -154,14 +156,13 @@ If you chose to deploy this chart as a standalone, remove the `registry` at the | `draintimeout` | `'0'` | Amount of time to wait for HTTP connections to drain after receiving a SIGTERM signal (e.g. `'10s'`) | | `relativeurls` | `false` | Enable the registry to return relative URLs in Location headers. | | `enabled` | `true` | Enable registry flag | +| `hpa.behaviour` | `{scaleDown: {stabilizationWindowSeconds: 300 }}` | Behavior contains the specifications for up- and downscaling behavior (requires `autoscaling/v2beta2` or higher) | | `hpa.cpu.targetAverageUtilization` | `75` | Target value of the average of the resource metric across all relevant pods which governs the HPA | -| `hpa.customBehavior` | `{}` | autoscaling/v2beta2 Behavior contains the specifications for up- and downscaling behavior (overrides the default use of `scaleDownStabilizationWindowSeconds`) | -| `hpa.customMetrics` | `[]` | autoscaling/v2beta2 Metrics contains the specifications for which to use to calculate the desired replica count (overrides the default use of Average CPU Utilization configured in `targetAverageUtilization`) | +| `hpa.customMetrics` | `[]` | Custom metrics contains the specifications for which to use to calculate the desired replica count (overrides the default use of Average CPU Utilization configured in `targetAverageUtilization`) | | `hpa.minReplicas` | `2` | Minimum number of replicas | | `hpa.maxReplicas` | `10` | Maximum number of replicas | -| `hpa.scaleDownStabilizationWindowSeconds` | `300` | Set the scaledown stabilization window in seconds (max 3600) | | `httpSecret` | | Https secret | -| `extraEnvFrom` | | List of extra environment variables from other data sources to expose | +| `extraEnvFrom` | | List of extra environment variables from other data sources to expose | | `image.pullPolicy` | | Pull policy for the registry image | | `image.pullSecrets` | | Secrets to use for image repository | | `image.repository` | `registry.gitlab.com/gitlab-org/build/cng/gitlab-container-registry` | Registry image | -- GitLab From 70c75abf7ba901ed7ae271b9e6d37b89f6fe425c Mon Sep 17 00:00:00 2001 From: Pierre Guinoiseau Date: Mon, 20 Jun 2022 22:12:32 +1200 Subject: [PATCH 13/13] Updates HPAs to support autoscaling/v2beta2 on Kubernetes <1.18 and autoscaling/v2 --- charts/gitlab/charts/gitlab-pages/templates/hpa.yaml | 8 +++++--- charts/gitlab/charts/gitlab-pages/values.yaml | 2 +- charts/gitlab/charts/gitlab-shell/templates/hpa.yaml | 8 +++++--- charts/gitlab/charts/kas/templates/hpa.yaml | 8 +++++--- charts/gitlab/charts/mailroom/templates/hpa.yaml | 8 +++++--- charts/gitlab/charts/mailroom/values.yaml | 2 +- charts/gitlab/charts/sidekiq/templates/hpa.yaml | 8 +++++--- charts/gitlab/charts/spamcheck/templates/hpa.yaml | 8 +++++--- charts/gitlab/charts/webservice/templates/hpa.yaml | 8 +++++--- charts/gitlab/charts/webservice/values.yaml | 2 +- charts/nginx-ingress/templates/controller-hpa.yaml | 10 ++++++---- .../nginx-ingress/templates/default-backend-hpa.yaml | 10 ++++++---- charts/registry/templates/hpa.yaml | 8 +++++--- charts/registry/values.yaml | 2 +- doc/charts/gitlab/mailroom/index.md | 2 +- 15 files changed, 57 insertions(+), 37 deletions(-) diff --git a/charts/gitlab/charts/gitlab-pages/templates/hpa.yaml b/charts/gitlab/charts/gitlab-pages/templates/hpa.yaml index 3a9698037c..f750c5722f 100644 --- a/charts/gitlab/charts/gitlab-pages/templates/hpa.yaml +++ b/charts/gitlab/charts/gitlab-pages/templates/hpa.yaml @@ -1,5 +1,7 @@ --- -{{- if .Capabilities.APIVersions.Has "autoscaling/v2beta2" }} +{{- if .Capabilities.APIVersions.Has "autoscaling/v2" }} +apiVersion: autoscaling/v2 +{{- else if .Capabilities.APIVersions.Has "autoscaling/v2beta2" }} apiVersion: autoscaling/v2beta2 {{- else }} apiVersion: autoscaling/v2beta1 @@ -23,7 +25,7 @@ spec: - type: Resource resource: name: cpu - {{- if .Capabilities.APIVersions.Has "autoscaling/v2beta2" }} + {{- if or (.Capabilities.APIVersions.Has "autoscaling/v2") (.Capabilities.APIVersions.Has "autoscaling/v2beta2") }} target: type: AverageValue averageValue: {{ .Values.hpa.targetAverageValue }} @@ -33,7 +35,7 @@ spec: {{- else }} {{- toYaml .Values.hpa.customMetrics | nindent 4 }} {{- end }} - {{- if .Capabilities.APIVersions.Has "autoscaling/v2beta2" }} + {{- if or (.Capabilities.APIVersions.Has "autoscaling/v2") (and (.Capabilities.APIVersions.Has "autoscaling/v2beta2") (semverCompare ">=1.18.0-0" .Capabilities.KubeVersion.Version)) }} {{- with .Values.hpa.behaviour }} behavior: {{- toYaml . | nindent 4 }} diff --git a/charts/gitlab/charts/gitlab-pages/values.yaml b/charts/gitlab/charts/gitlab-pages/values.yaml index c048f32c11..3ab5ef6da8 100644 --- a/charts/gitlab/charts/gitlab-pages/values.yaml +++ b/charts/gitlab/charts/gitlab-pages/values.yaml @@ -13,7 +13,7 @@ hpa: maxReplicas: 10 minReplicas: 1 targetAverageValue: 100m - # Note that the HPA is limited to autoscaling/v2beta1 and autoscaling/v2beta2 + # Note that the HPA is limited to autoscaling/v2beta1, autoscaling/v2beta2 and autoscaling/v2 customMetrics: [] # Overrides HPA metrics definition behaviour: scaleDown: diff --git a/charts/gitlab/charts/gitlab-shell/templates/hpa.yaml b/charts/gitlab/charts/gitlab-shell/templates/hpa.yaml index 14c1c2cdeb..fc8af51214 100644 --- a/charts/gitlab/charts/gitlab-shell/templates/hpa.yaml +++ b/charts/gitlab/charts/gitlab-shell/templates/hpa.yaml @@ -1,6 +1,8 @@ {{- if .Values.enabled -}} --- -{{- if .Capabilities.APIVersions.Has "autoscaling/v2beta2" }} +{{- if .Capabilities.APIVersions.Has "autoscaling/v2" }} +apiVersion: autoscaling/v2 +{{- else if .Capabilities.APIVersions.Has "autoscaling/v2beta2" }} apiVersion: autoscaling/v2beta2 {{- else }} apiVersion: autoscaling/v2beta1 @@ -23,14 +25,14 @@ spec: - type: Resource resource: name: cpu - {{- if .Capabilities.APIVersions.Has "autoscaling/v2beta2" }} + {{- if or (.Capabilities.APIVersions.Has "autoscaling/v2") (.Capabilities.APIVersions.Has "autoscaling/v2beta2") }} target: type: AverageValue averageValue: {{ .Values.hpa.targetAverageValue }} {{- else }} targetAverageValue: {{ .Values.hpa.targetAverageValue }} {{- end }} - {{- if .Capabilities.APIVersions.Has "autoscaling/v2beta2" }} + {{- if or (.Capabilities.APIVersions.Has "autoscaling/v2") (and (.Capabilities.APIVersions.Has "autoscaling/v2beta2") (semverCompare ">=1.18.0-0" .Capabilities.KubeVersion.Version)) }} {{- with .Values.hpa.behaviour }} behavior: {{- toYaml . | nindent 4 }} diff --git a/charts/gitlab/charts/kas/templates/hpa.yaml b/charts/gitlab/charts/kas/templates/hpa.yaml index 430c7cdf16..188d70bbe9 100644 --- a/charts/gitlab/charts/kas/templates/hpa.yaml +++ b/charts/gitlab/charts/kas/templates/hpa.yaml @@ -1,6 +1,8 @@ {{- if .Values.global.kas.enabled -}} --- -{{- if .Capabilities.APIVersions.Has "autoscaling/v2beta2" }} +{{- if .Capabilities.APIVersions.Has "autoscaling/v2" }} +apiVersion: autoscaling/v2 +{{- else if .Capabilities.APIVersions.Has "autoscaling/v2beta2" }} apiVersion: autoscaling/v2beta2 {{- else }} apiVersion: autoscaling/v2beta1 @@ -23,14 +25,14 @@ spec: - type: Resource resource: name: cpu - {{- if .Capabilities.APIVersions.Has "autoscaling/v2beta2" }} + {{- if or (.Capabilities.APIVersions.Has "autoscaling/v2") (.Capabilities.APIVersions.Has "autoscaling/v2beta2") }} target: type: AverageValue averageValue: {{ .Values.hpa.targetAverageValue }} {{- else }} targetAverageValue: {{ .Values.hpa.targetAverageValue }} {{- end }} - {{- if .Capabilities.APIVersions.Has "autoscaling/v2beta2" }} + {{- if or (.Capabilities.APIVersions.Has "autoscaling/v2") (and (.Capabilities.APIVersions.Has "autoscaling/v2beta2") (semverCompare ">=1.18.0-0" .Capabilities.KubeVersion.Version)) }} {{- with .Values.hpa.behaviour }} behavior: {{- toYaml . | nindent 4 }} diff --git a/charts/gitlab/charts/mailroom/templates/hpa.yaml b/charts/gitlab/charts/mailroom/templates/hpa.yaml index bbcf373ca4..667e02b8ab 100644 --- a/charts/gitlab/charts/mailroom/templates/hpa.yaml +++ b/charts/gitlab/charts/mailroom/templates/hpa.yaml @@ -1,6 +1,8 @@ {{- if and .Values.enabled .Values.global.appConfig.incomingEmail.enabled }} --- -{{- if .Capabilities.APIVersions.Has "autoscaling/v2beta2" }} +{{- if .Capabilities.APIVersions.Has "autoscaling/v2" }} +apiVersion: autoscaling/v2 +{{- else if .Capabilities.APIVersions.Has "autoscaling/v2beta2" }} apiVersion: autoscaling/v2beta2 {{- else }} apiVersion: autoscaling/v2beta1 @@ -24,7 +26,7 @@ spec: - type: Resource resource: name: cpu - {{- if .Capabilities.APIVersions.Has "autoscaling/v2beta2" }} + {{- if or (.Capabilities.APIVersions.Has "autoscaling/v2") (.Capabilities.APIVersions.Has "autoscaling/v2beta2") }} target: type: Utilization averageUtilization: {{ .Values.hpa.cpu.targetAverageUtilization }} @@ -34,7 +36,7 @@ spec: {{- else -}} {{- toYaml .Values.hpa.customMetrics | nindent 4 -}} {{- end }} - {{- if .Capabilities.APIVersions.Has "autoscaling/v2beta2" }} + {{- if or (.Capabilities.APIVersions.Has "autoscaling/v2") (and (.Capabilities.APIVersions.Has "autoscaling/v2beta2") (semverCompare ">=1.18.0-0" .Capabilities.KubeVersion.Version)) }} {{- with .Values.hpa.behaviour }} behavior: {{- toYaml . | nindent 4 }} diff --git a/charts/gitlab/charts/mailroom/values.yaml b/charts/gitlab/charts/mailroom/values.yaml index dc7b86f377..f46832217a 100644 --- a/charts/gitlab/charts/mailroom/values.yaml +++ b/charts/gitlab/charts/mailroom/values.yaml @@ -87,7 +87,7 @@ hpa: maxReplicas: 2 cpu: targetAverageUtilization: 75 - # Note that the HPA is limited to autoscaling/v2beta1 and autoscaling/v2beta2 + # Note that the HPA is limited to autoscaling/v2beta1, autoscaling/v2beta2 and autoscaling/v2 customMetrics: [] # Overrides HPA metrics definition behaviour: scaleDown: diff --git a/charts/gitlab/charts/sidekiq/templates/hpa.yaml b/charts/gitlab/charts/sidekiq/templates/hpa.yaml index 712090dffc..a3087be5d3 100644 --- a/charts/gitlab/charts/sidekiq/templates/hpa.yaml +++ b/charts/gitlab/charts/sidekiq/templates/hpa.yaml @@ -7,7 +7,9 @@ {{- $hpa := default dict .hpa }} {{- include "sidekiq.pod.common.labels" . }} --- -{{- if $.Capabilities.APIVersions.Has "autoscaling/v2beta2" }} +{{- if $.Capabilities.APIVersions.Has "autoscaling/v2" }} +apiVersion: autoscaling/v2 +{{- else if $.Capabilities.APIVersions.Has "autoscaling/v2beta2" }} apiVersion: autoscaling/v2beta2 {{- else }} apiVersion: autoscaling/v2beta1 @@ -30,14 +32,14 @@ spec: - type: Resource resource: name: cpu - {{- if $.Capabilities.APIVersions.Has "autoscaling/v2beta2" }} + {{- if or ($.Capabilities.APIVersions.Has "autoscaling/v2") ($.Capabilities.APIVersions.Has "autoscaling/v2beta2") }} target: type: AverageValue averageValue: {{ default $.Values.hpa.targetAverageValue $hpa.targetAverageValue }} {{- else }} targetAverageValue: {{ default $.Values.hpa.targetAverageValue $hpa.targetAverageValue }} {{- end }} - {{- if $.Capabilities.APIVersions.Has "autoscaling/v2beta2" }} + {{- if or ($.Capabilities.APIVersions.Has "autoscaling/v2") (and ($.Capabilities.APIVersions.Has "autoscaling/v2beta2") (semverCompare ">=1.18.0-0" $.Capabilities.KubeVersion.Version)) }} {{- with default $.Values.hpa.behaviour $hpa.behaviour }} behavior: {{- toYaml . | nindent 4 }} diff --git a/charts/gitlab/charts/spamcheck/templates/hpa.yaml b/charts/gitlab/charts/spamcheck/templates/hpa.yaml index de430ad03f..55653011d3 100644 --- a/charts/gitlab/charts/spamcheck/templates/hpa.yaml +++ b/charts/gitlab/charts/spamcheck/templates/hpa.yaml @@ -1,6 +1,8 @@ {{- if .Values.global.spamcheck.enabled -}} --- -{{- if .Capabilities.APIVersions.Has "autoscaling/v2beta2" }} +{{- if .Capabilities.APIVersions.Has "autoscaling/v2" }} +apiVersion: autoscaling/v2 +{{- else if .Capabilities.APIVersions.Has "autoscaling/v2beta2" }} apiVersion: autoscaling/v2beta2 {{- else }} apiVersion: autoscaling/v2beta1 @@ -24,7 +26,7 @@ spec: - type: Resource resource: name: cpu - {{- if .Capabilities.APIVersions.Has "autoscaling/v2beta2" }} + {{- if or (.Capabilities.APIVersions.Has "autoscaling/v2") (.Capabilities.APIVersions.Has "autoscaling/v2beta2") }} target: type: AverageValue averageValue: {{ .Values.hpa.targetAverageValue }} @@ -34,7 +36,7 @@ spec: {{- else }} {{- toYaml .Values.hpa.customMetrics | nindent 4 -}} {{- end }} - {{- if .Capabilities.APIVersions.Has "autoscaling/v2beta2" }} + {{- if or (.Capabilities.APIVersions.Has "autoscaling/v2") (and (.Capabilities.APIVersions.Has "autoscaling/v2beta2") (semverCompare ">=1.18.0-0" .Capabilities.KubeVersion.Version)) }} {{- with .Values.hpa.behaviour }} behavior: {{- toYaml . | nindent 4 }} diff --git a/charts/gitlab/charts/webservice/templates/hpa.yaml b/charts/gitlab/charts/webservice/templates/hpa.yaml index babb6be0c9..23adcab734 100644 --- a/charts/gitlab/charts/webservice/templates/hpa.yaml +++ b/charts/gitlab/charts/webservice/templates/hpa.yaml @@ -8,7 +8,9 @@ From here on: - `.name` is the key (xyz) */}} --- -{{- if $.Capabilities.APIVersions.Has "autoscaling/v2beta2" }} +{{- if $.Capabilities.APIVersions.Has "autoscaling/v2" }} +apiVersion: autoscaling/v2 +{{- else if $.Capabilities.APIVersions.Has "autoscaling/v2beta2" }} apiVersion: autoscaling/v2beta2 {{- else }} apiVersion: autoscaling/v2beta1 @@ -33,7 +35,7 @@ spec: - type: Resource resource: name: cpu - {{- if $.Capabilities.APIVersions.Has "autoscaling/v2beta2" }} + {{- if or ($.Capabilities.APIVersions.Has "autoscaling/v2") ($.Capabilities.APIVersions.Has "autoscaling/v2beta2") }} target: type: AverageValue averageValue: {{ .hpa.targetAverageValue }} @@ -43,7 +45,7 @@ spec: {{- else }} {{- toYaml .hpa.customMetrics | nindent 4 }} {{- end }} - {{- if $.Capabilities.APIVersions.Has "autoscaling/v2beta2" }} + {{- if or ($.Capabilities.APIVersions.Has "autoscaling/v2") (and ($.Capabilities.APIVersions.Has "autoscaling/v2beta2") (semverCompare ">=1.18.0-0" $.Capabilities.KubeVersion.Version)) }} {{- with .hpa.behaviour }} behavior: {{- toYaml . | nindent 4 }} diff --git a/charts/gitlab/charts/webservice/values.yaml b/charts/gitlab/charts/webservice/values.yaml index 0036b62603..ced49e775a 100644 --- a/charts/gitlab/charts/webservice/values.yaml +++ b/charts/gitlab/charts/webservice/values.yaml @@ -122,7 +122,7 @@ puma: hpa: targetAverageValue: 1 - # Note that the HPA is limited to autoscaling/v2beta1 and autoscaling/v2beta2 + # Note that the HPA is limited to autoscaling/v2beta1, autoscaling/v2beta2 and autoscaling/v2 customMetrics: [] # Overrides HPA metrics definition behaviour: scaleDown: diff --git a/charts/nginx-ingress/templates/controller-hpa.yaml b/charts/nginx-ingress/templates/controller-hpa.yaml index ff9dffaccc..8af4559940 100644 --- a/charts/nginx-ingress/templates/controller-hpa.yaml +++ b/charts/nginx-ingress/templates/controller-hpa.yaml @@ -1,7 +1,9 @@ {{- if and .Values.controller.autoscaling.enabled (or (eq .Values.controller.kind "Deployment") (eq .Values.controller.kind "Both")) -}} {{- if not .Values.controller.keda.enabled }} --- -{{- if .Capabilities.APIVersions.Has "autoscaling/v2beta2" }} +{{- if .Capabilities.APIVersions.Has "autoscaling/v2" }} +apiVersion: autoscaling/v2 +{{- else if .Capabilities.APIVersions.Has "autoscaling/v2beta2" }} apiVersion: autoscaling/v2beta2 {{- else }} apiVersion: autoscaling/v2beta1 @@ -32,7 +34,7 @@ spec: - type: Resource resource: name: memory - {{- if $.Capabilities.APIVersions.Has "autoscaling/v2beta2" }} + {{- if or ($.Capabilities.APIVersions.Has "autoscaling/v2") ($.Capabilities.APIVersions.Has "autoscaling/v2beta2") }} target: type: Utilization averageUtilization: {{ . }} @@ -44,7 +46,7 @@ spec: - type: Resource resource: name: cpu - {{- if $.Capabilities.APIVersions.Has "autoscaling/v2beta2" }} + {{- if or ($.Capabilities.APIVersions.Has "autoscaling/v2") ($.Capabilities.APIVersions.Has "autoscaling/v2beta2") }} target: type: Utilization averageUtilization: {{ . }} @@ -55,7 +57,7 @@ spec: {{- with .Values.controller.autoscalingTemplate }} {{- toYaml . | nindent 2 }} {{- end }} - {{- if .Capabilities.APIVersions.Has "autoscaling/v2beta2" }} + {{- if or (.Capabilities.APIVersions.Has "autoscaling/v2") (and (.Capabilities.APIVersions.Has "autoscaling/v2beta2") (semverCompare ">=1.18.0-0" .Capabilities.KubeVersion.Version)) }} {{- with .Values.controller.autoscaling.behavior }} behavior: {{- toYaml . | nindent 4 }} diff --git a/charts/nginx-ingress/templates/default-backend-hpa.yaml b/charts/nginx-ingress/templates/default-backend-hpa.yaml index 085517b909..efc49fb64c 100644 --- a/charts/nginx-ingress/templates/default-backend-hpa.yaml +++ b/charts/nginx-ingress/templates/default-backend-hpa.yaml @@ -1,6 +1,8 @@ {{- if and .Values.defaultBackend.enabled .Values.defaultBackend.autoscaling.enabled }} --- -{{- if .Capabilities.APIVersions.Has "autoscaling/v2beta2" }} +{{- if .Capabilities.APIVersions.Has "autoscaling/v2" }} +apiVersion: autoscaling/v2 +{{- else if .Capabilities.APIVersions.Has "autoscaling/v2beta2" }} apiVersion: autoscaling/v2beta2 {{- else }} apiVersion: autoscaling/v2beta1 @@ -27,7 +29,7 @@ spec: - type: Resource resource: name: cpu - {{- if $.Capabilities.APIVersions.Has "autoscaling/v2beta2" }} + {{- if or ($.Capabilities.APIVersions.Has "autoscaling/v2") ($.Capabilities.APIVersions.Has "autoscaling/v2beta2") }} target: type: Utilization averageUtilization: {{ . }} @@ -39,7 +41,7 @@ spec: - type: Resource resource: name: memory - {{- if $.Capabilities.APIVersions.Has "autoscaling/v2beta2" }} + {{- if or ($.Capabilities.APIVersions.Has "autoscaling/v2") ($.Capabilities.APIVersions.Has "autoscaling/v2beta2") }} target: type: Utilization averageUtilization: {{ . }} @@ -47,7 +49,7 @@ spec: targetAverageUtilization: {{ . }} {{- end }} {{- end }} - {{- if .Capabilities.APIVersions.Has "autoscaling/v2beta2" }} + {{- if or (.Capabilities.APIVersions.Has "autoscaling/v2") (and (.Capabilities.APIVersions.Has "autoscaling/v2beta2") (semverCompare ">=1.18.0-0" .Capabilities.KubeVersion.Version)) }} {{- with .Values.defaultBackend.autoscaling.behaviour }} behavior: {{- toYaml . | nindent 4 }} diff --git a/charts/registry/templates/hpa.yaml b/charts/registry/templates/hpa.yaml index 27259ca0ae..9e0eb62fc7 100644 --- a/charts/registry/templates/hpa.yaml +++ b/charts/registry/templates/hpa.yaml @@ -1,6 +1,8 @@ {{- if .Values.enabled -}} --- -{{- if .Capabilities.APIVersions.Has "autoscaling/v2beta2" }} +{{- if .Capabilities.APIVersions.Has "autoscaling/v2" }} +apiVersion: autoscaling/v2 +{{- else if .Capabilities.APIVersions.Has "autoscaling/v2beta2" }} apiVersion: autoscaling/v2beta2 {{- else }} apiVersion: autoscaling/v2beta1 @@ -24,7 +26,7 @@ spec: - type: Resource resource: name: cpu - {{- if .Capabilities.APIVersions.Has "autoscaling/v2beta2" }} + {{- if or (.Capabilities.APIVersions.Has "autoscaling/v2") (.Capabilities.APIVersions.Has "autoscaling/v2beta2") }} target: type: Utilization averageUtilization: {{ .Values.hpa.cpu.targetAverageUtilization }} @@ -34,7 +36,7 @@ spec: {{- else -}} {{- toYaml .Values.hpa.customMetrics | nindent 4 -}} {{- end }} - {{- if .Capabilities.APIVersions.Has "autoscaling/v2beta2" }} + {{- if or (.Capabilities.APIVersions.Has "autoscaling/v2") (and (.Capabilities.APIVersions.Has "autoscaling/v2beta2") (semverCompare ">=1.18.0-0" .Capabilities.KubeVersion.Version)) }} {{- with .Values.hpa.behaviour }} behavior: {{- toYaml . | nindent 4 }} diff --git a/charts/registry/values.yaml b/charts/registry/values.yaml index 797df31ebb..b33c344204 100644 --- a/charts/registry/values.yaml +++ b/charts/registry/values.yaml @@ -224,7 +224,7 @@ hpa: maxReplicas: 10 cpu: targetAverageUtilization: 75 - # Note that the HPA is limited to autoscaling/v2beta1 and autoscaling/v2beta2 + # Note that the HPA is limited to autoscaling/v2beta1, autoscaling/v2beta2 and autoscaling/v2 customMetrics: [] # Overrides HPA metrics definition behaviour: scaleDown: diff --git a/doc/charts/gitlab/mailroom/index.md b/doc/charts/gitlab/mailroom/index.md index a51cb51b17..f632f3d3f1 100644 --- a/doc/charts/gitlab/mailroom/index.md +++ b/doc/charts/gitlab/mailroom/index.md @@ -38,7 +38,7 @@ hpa: cpu: targetAverageUtilization: 75 - # Note that the HPA is limited to autoscaling/v2beta1 and autoscaling/v2beta2 + # Note that the HPA is limited to autoscaling/v2beta1, autoscaling/v2beta2 and autoscaling/v2 customMetrics: [] behavior: {} -- GitLab