Skip to content

Commit 3a739a3

Browse files
committed
Add behavior for hpa
1 parent 99162f1 commit 3a739a3

File tree

2 files changed

+38
-16
lines changed

2 files changed

+38
-16
lines changed

osm-seed/templates/web/web-hpa.yaml

Lines changed: 25 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,29 @@ spec:
1111
minReplicas: {{ .Values.web.autoscaling.minReplicas }}
1212
maxReplicas: {{ .Values.web.autoscaling.maxReplicas }}
1313
metrics:
14-
- type: Resource
15-
resource:
16-
name: cpu
17-
target:
18-
type: Utilization
19-
averageUtilization: {{ .Values.web.autoscaling.cpuUtilization }}
20-
- type: Resource
21-
resource:
22-
name: memory
23-
target:
24-
type: Utilization
25-
averageUtilization: {{ .Values.web.autoscaling.memoryUtilization }}
14+
- type: Resource
15+
resource:
16+
name: cpu
17+
target:
18+
type: Utilization
19+
averageUtilization: {{ .Values.web.autoscaling.cpuUtilization }}
20+
- type: Resource
21+
resource:
22+
name: memory
23+
target:
24+
type: Utilization
25+
averageUtilization: {{ .Values.web.autoscaling.memoryUtilization }}
26+
behavior:
27+
scaleUp:
28+
stabilizationWindowSeconds: {{ .Values.web.autoscaling.behavior.scaleUp.stabilizationWindowSeconds | default 60 }}
29+
policies:
30+
- type: Percent
31+
value: {{ .Values.web.autoscaling.behavior.scaleUp.policyValue | default 100 }}
32+
periodSeconds: {{ .Values.web.autoscaling.behavior.scaleUp.periodSeconds | default 60 }}
33+
scaleDown:
34+
stabilizationWindowSeconds: {{ .Values.web.autoscaling.behavior.scaleDown.stabilizationWindowSeconds | default 60 }}
35+
policies:
36+
- type: Percent
37+
value: {{ .Values.web.autoscaling.behavior.scaleDown.policyValue | default 50 }}
38+
periodSeconds: {{ .Values.web.autoscaling.behavior.scaleDown.periodSeconds | default 60 }}
2639
{{- end }}

osm-seed/values.yaml

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -175,11 +175,20 @@ web:
175175
nodeSelector:
176176
enabled: false
177177
autoscaling:
178-
enabled: false
178+
enabled: true
179179
minReplicas: 1
180-
maxReplicas: 3
181-
cpuUtilization: 60
182-
memoryUtilization: 60
180+
maxReplicas: 6
181+
cpuUtilization: 85
182+
memoryUtilization: 85
183+
behavior:
184+
scaleUp:
185+
stabilizationWindowSeconds: 60
186+
policyValue: 100
187+
periodSeconds: 60
188+
scaleDown:
189+
stabilizationWindowSeconds: 60
190+
policyValue: 50
191+
periodSeconds: 60
183192
sharedMemorySize: 256Mi
184193
livenessProbeExec: true
185194
# ====================================================================================================

0 commit comments

Comments
 (0)