From ef359bdf91adea316c9cc3d399e0214e169989ab Mon Sep 17 00:00:00 2001 From: Philip Stadermann Date: Thu, 5 Oct 2023 10:57:43 +0200 Subject: [PATCH] Allow configuring auto scaler metrics --- README.md | 11 +++++++---- charts/gdscan/Chart.yaml | 2 +- .../gdscan/templates/horizontal-pod-autoscaler.yaml | 4 ++++ charts/gdscan/values.yaml | 1 + 4 files changed, 13 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 67d2b32..26280ff 100644 --- a/README.md +++ b/README.md @@ -63,9 +63,12 @@ For pricing details please [contact us](mailto:oem@gdata.de). A free trial is po # Options -| Name | Description | Value | -| ---------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- | ------------------------ | +| Name | Description | Value | +| ---------------------------------- | --------------------------------------------------------------------------------------------------------------------- | ------------------------ | | `service.type` | service type | `ClusterIP` | | `service.ports.api` | API service port | `8080` | -| `service.annotations` | service annotations | `{}` | -| `replicaCount` | number of pods | `1` | +| `service.annotations` | service annotations | `{}` | +| `replicaCount` | number of pods | `1` | +| `autoscaling.enabled` | enable auto scaling | `false` | +| `autoscaling.maxReplicas` | maximum number of replicas | `20` | +| `autoscaling.metrics` | custom metrics for auto scaling | | diff --git a/charts/gdscan/Chart.yaml b/charts/gdscan/Chart.yaml index a39304d..f5336e5 100644 --- a/charts/gdscan/Chart.yaml +++ b/charts/gdscan/Chart.yaml @@ -5,4 +5,4 @@ maintainers: - name: G DATA CyberDefense AG email: oem@gdata.de type: application -version: 1.1.4 +version: 1.2.0 diff --git a/charts/gdscan/templates/horizontal-pod-autoscaler.yaml b/charts/gdscan/templates/horizontal-pod-autoscaler.yaml index 44577a5..89b4a31 100644 --- a/charts/gdscan/templates/horizontal-pod-autoscaler.yaml +++ b/charts/gdscan/templates/horizontal-pod-autoscaler.yaml @@ -16,6 +16,9 @@ spec: name: {{ include "gdscan.fullname" . }} minReplicas: {{ .Values.autoscaling.minReplicas }} maxReplicas: {{ .Values.autoscaling.maxReplicas }} + {{- if .Values.autoscaling.metrics }} + metrics: {{- toYaml .Values.autoscaling.metrics | nindent 4 }} + {{- else }} metrics: - type: Resource resource: @@ -23,4 +26,5 @@ spec: target: type: Utilization averageUtilization: {{ .Values.autoscaling.targetCPU }} + {{- end }} {{- end }} \ No newline at end of file diff --git a/charts/gdscan/values.yaml b/charts/gdscan/values.yaml index dc631e1..8b69ae3 100644 --- a/charts/gdscan/values.yaml +++ b/charts/gdscan/values.yaml @@ -61,6 +61,7 @@ autoscaling: minReplicas: 2 maxReplicas: 20 targetCPU: 75 + metrics: nodeSelector: {}