Skip to content

Commit

Permalink
Update service-deployment HPA metrics (closes #202)
Browse files Browse the repository at this point in the history
  • Loading branch information
ianarsenault committed Oct 25, 2024
1 parent eaa457d commit efea769
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 10 deletions.
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

0 comments on commit efea769

Please sign in to comment.