Skip to content
This repository has been archived by the owner on Jun 26, 2024. It is now read-only.

chore: configure hpa behavior #199

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
17 changes: 17 additions & 0 deletions helm/templates/hpa.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,23 @@ metadata:
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
{{- if .Values.hpa.behavior.enabled }}
behavior:
scaleUp:
policies:
- type: {{ .Values.hpa.behavior.scaleUp.policy.type }}
value: {{ .Values.hpa.behavior.scaleUp.policy.value }}
periodSeconds: {{ .Values.hpa.behavior.scaleUp.policy.periodSeconds }}
selectPolicy: {{ .Values.hpa.behavior.scaleUp.selectPolicy }}
stabilizationWindowSeconds: {{ .Values.hpa.behavior.scaleUp.stabilizationWindowSeconds }}
scaleDown:
policies:
- type: {{ .Values.hpa.behavior.scaleDown.policy.type }}
value: {{ .Values.hpa.behavior.scaleDown.policy.value }}
periodSeconds: {{ .Values.hpa.behavior.scaleDown.policy.periodSeconds }}
selectPolicy: {{ .Values.hpa.behavior.scaleDown.selectPolicy }}
stabilizationWindowSeconds: {{ .Values.hpa.behavior.scaleDown.selectPolicy }}
{{- end }}
minReplicas: {{ int .Values.hpa.minReplicas }}
maxReplicas: {{ int .Values.hpa.maxReplicas }}
scaleTargetRef:
Expand Down
16 changes: 16 additions & 0 deletions helm/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -97,3 +97,19 @@ hpa:
minReplicas: 1
maxReplicas: 5
targetCPUUtilizationPercentage: 80
behavior:
enabled: true
scaleUp:
policy:
type: Pods
value: 2

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ravisingal In simple words, this scaleUp policy will add max 2 pods within any 60 sec (until it reaches maxReplicas) and scaleDown policy will remove min 1 pod within any 600 sec (until it reaches minReplicas) after looking at previous window of 600 seconds, right?

periodSeconds: 60
selectPolicy: Max
stabilizationWindowSeconds: 0
scaleDown:
policy:
type: Pods
value: 1
periodSeconds: 600
selectPolicy: Min
stabilizationWindowSeconds: 600
Loading