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

Update service-deployment HPA metrics (closes #202) #204

Merged
merged 2 commits into from
Oct 28, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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/service-deployment/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: v2
name: service-deployment
description: A Helm Chart to setup a generic deployment with optional service/hpa bindings
version: 0.20.0
version: 0.21.0
icon: https://raw.githubusercontent.com/snowplow-devops/helm-charts/master/docs/logo/snowplow.png
home: https://github.com/snowplow-devops/helm-charts
sources:
Expand Down
2 changes: 1 addition & 1 deletion charts/service-deployment/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ helm delete service-deployment
| fullnameOverride | string | `""` | Overrides the full-name given to the deployment resources (default: .Release.Name) |
| global.cloud | string | `""` | Cloud specific bindings (options: aws, gcp , azure) |
| global.labels | object | `{}` | Global labels deployed to all resources deployed by the chart |
| hpa.averageCPUUtilization | int | `75` | Average CPU utilization before auto-scaling starts |
| hpa.metrics | object | `[{"type":"Resource","resource":{"name":"cpu","target":{"type":"Utilization","averageUtilization":75}}}]` | Metrics for HPA configuration |
| hpa.behavior | object | `{}` | |
| hpa.deploy | bool | `true` | Whether to deploy HPA rules |
| hpa.maxReplicas | int | `20` | Maximum number of pods to deploy |
Expand Down
9 changes: 3 additions & 6 deletions charts/service-deployment/templates/hpa.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,10 @@ spec:
name: {{ include "app.fullname" . }}
minReplicas: {{ .Values.hpa.minReplicas }}
maxReplicas: {{ .Values.hpa.maxReplicas }}
{{- if .Values.hpa.metrics }}
metrics:
- type: Resource
resource:
name: cpu
target:
type: Utilization
averageUtilization: {{ .Values.hpa.averageCPUUtilization }}
{{- toYaml .Values.hpa.metrics | nindent 4 }}
{{- end }}
behavior:
{{- toYaml .Values.hpa.behavior | nindent 4 }}
{{- end }}
10 changes: 8 additions & 2 deletions charts/service-deployment/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,14 @@ hpa:
minReplicas: 1
# -- Maximum number of pods to deploy
maxReplicas: 20
# -- Average CPU utilization before auto-scaling starts
averageCPUUtilization: 75
# -- Default average CPU utilization before auto-scaling starts
metrics:
- type: Resource
resource:
name: cpu
target:
type: Utilization
averageUtilization: 75
behavior: {}

service:
Expand Down
Loading