Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add HPA custom metrics to common helm chart #358

Merged
merged 1 commit into from
Sep 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion charts/common/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
3 changes: 2 additions & 1 deletion charts/common/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 |
Expand Down
3 changes: 3 additions & 0 deletions charts/common/templates/hpa.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,7 @@ spec:
targetAverageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }}
{{- end }}
{{- end }}
{{- if .Values.autoscaling.customMetrics }}
{{- toYaml .Values.autoscaling.customMetrics | nindent 8 }}
{{- end }}
{{- end }}
2 changes: 2 additions & 0 deletions charts/common/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading