diff --git a/charts/common/Chart.yaml b/charts/common/Chart.yaml index 78653d20..2d3b6408 100644 --- a/charts/common/Chart.yaml +++ b/charts/common/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v2 name: common description: A generic helm chart for Kubernetes type: application -version: 0.7.2 +version: 0.8.0 maintainers: - name: Parity url: https://github.com/paritytech/helm-charts diff --git a/charts/common/README.md b/charts/common/README.md index 25f0300b..e58ba1cc 100644 --- a/charts/common/README.md +++ b/charts/common/README.md @@ -25,7 +25,8 @@ This is intended behaviour. Make sure to run `git add -A` once again to stage ch | additionalPodSpec | object | `{}` | Additional Pod Spec | | affinity | object | `{}` | Assign custom affinity rules | | args | list | `[]` | Override default container args | -| autoscaling | object | `{"enabled":false,"maxReplicas":100,"minReplicas":1,"targetCPUUtilizationPercentage":80}` | Autoscaling should be enabled for statefulsets ref: https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/ | +| autoscaling | object | `{"customMetrics":[],"enabled":false,"maxReplicas":100,"minReplicas":1,"targetCPUUtilizationPercentage":80}` | Autoscaling should be enabled for statefulsets ref: https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/ | +| autoscaling.customMetrics | list | `[]` | Custom HPA metrics | | autoscaling.enabled | bool | `false` | Enable autoscaling | | autoscaling.maxReplicas | int | `100` | Maximum number of pods | | autoscaling.minReplicas | int | `1` | Minimum number of pods | diff --git a/charts/common/templates/hpa.yaml b/charts/common/templates/hpa.yaml index b3fa15cf..b8d7a2a3 100644 --- a/charts/common/templates/hpa.yaml +++ b/charts/common/templates/hpa.yaml @@ -42,4 +42,7 @@ spec: targetAverageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }} {{- end }} {{- end }} + {{- if .Values.autoscaling.customMetrics }} + {{- toYaml .Values.autoscaling.customMetrics | nindent 8 }} + {{- end }} {{- end }} diff --git a/charts/common/values.yaml b/charts/common/values.yaml index 6f8653de..9ea45488 100644 --- a/charts/common/values.yaml +++ b/charts/common/values.yaml @@ -248,6 +248,8 @@ autoscaling: # -- Target CPU utilization percentage targetCPUUtilizationPercentage: 80 # targetMemoryUtilizationPercentage: 80 + # -- Custom HPA metrics + customMetrics: [] # -- If enabled, create service monitor of Prometheus-Operator # ref: https://github.com/prometheus-operator/prometheus-operator/blob/main/Documentation/user-guides/getting-started.md#include-servicemonitors