Skip to content

Commit

Permalink
update hpa on deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
nickkounz committed Sep 10, 2024
1 parent b0714f7 commit 9e71b60
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 7 deletions.
4 changes: 2 additions & 2 deletions charts/common/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.0.34
version: 0.0.35

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.
# It is recommended to use it with quotes.
appVersion: "0.0.34"
appVersion: "0.0.35"
icon: https://cncf-branding.netlify.app/img/projects/helm/horizontal/color/helm-horizontal-color.png
19 changes: 19 additions & 0 deletions charts/common/templates/hpa.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,23 @@ spec:
type: Utilization
averageUtilization: {{ .Values.autoscaling.targetMemoryUtilizationPercentage }}
{{- end }}
{{- if or .Values.autoscaling.scaleUp .Values.autoscaling.scaleDown }}
behavior:
{{- if .Values.autoscaling.scaleUp }}
scaleUp:
stabilizationWindowSeconds: {{ .Values.autoscaling.scaleUp.stabilizationWindowSeconds }}
policies:
- type: {{ .Values.autoscaling.scaleUp.policyType }}
value: {{ .Values.autoscaling.scaleUp.value }}
periodSeconds: {{ .Values.autoscaling.scaleUp.periodSeconds }}
{{- end }}
{{- if .Values.autoscaling.scaleDown }}
scaleDown:
stabilizationWindowSeconds: {{ .Values.autoscaling.scaleDown.stabilizationWindowSeconds }}
policies:
- type: {{ .Values.autoscaling.scaleDown.policyType }}
value: {{ .Values.autoscaling.scaleDown.value }}
periodSeconds: {{ .Values.autoscaling.scaleDown.periodSeconds }}
{{- end }}
{{- end }}
{{- end }}
20 changes: 15 additions & 5 deletions charts/common/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -225,11 +225,21 @@ resources:
# memory: 128Mi

autoscaling: {}
# enabled: false
# minReplicas: 1
# maxReplicas: 1
# targetCPUUtilizationPercentage: 80
# targetMemoryUtilizationPercentage: 80
# enabled: false
# minReplicas: 2
# maxReplicas: 6
# targetCPUUtilizationPercentage: 80
# targetMemoryUtilizationPercentage: 80
# scaleUp:
# stabilizationWindowSeconds: 30
# policyType: pod
# value: 6
# periodSeconds: 30
# scaleDown:
# stabilizationWindowSeconds: 300
# policyType: pod
# value: 2
# periodSeconds: 30

nodeSelector: {}

Expand Down

0 comments on commit 9e71b60

Please sign in to comment.