Skip to content

Commit 964f79b

Browse files
committed
feat(hpa): update behavior configuration to support null values for memory utilization and ensure proper referencing in HPA settings
1 parent 55d3170 commit 964f79b

File tree

4 files changed

+14
-14
lines changed

4 files changed

+14
-14
lines changed

charts/netbox/templates/hpa.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ spec:
1616
name: {{ include "common.names.fullname" . }}
1717
minReplicas: {{ .Values.autoscaling.minReplicas }}
1818
maxReplicas: {{ .Values.autoscaling.maxReplicas }}
19-
{{- with .Values.autoscaling.behavior }}
19+
{{- if .Values.autoscaling.behavior }}
2020
behavior:
21-
{{- with .scaleUp }}
21+
{{- with .Values.autoscaling.behavior.scaleUp }}
2222
scaleUp:
2323
{{- if .stabilizationWindowSeconds }}
2424
stabilizationWindowSeconds: {{ .stabilizationWindowSeconds }}
@@ -35,7 +35,7 @@ spec:
3535
{{- end }}
3636
{{- end }}
3737
{{- end }}
38-
{{- with .scaleDown }}
38+
{{- with .Values.autoscaling.behavior.scaleDown }}
3939
scaleDown:
4040
{{- if .stabilizationWindowSeconds }}
4141
stabilizationWindowSeconds: {{ .stabilizationWindowSeconds }}

charts/netbox/templates/worker/hpa.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ spec:
1616
name: {{ include "common.names.fullname" . }}-worker
1717
minReplicas: {{ .Values.worker.autoscaling.minReplicas }}
1818
maxReplicas: {{ .Values.worker.autoscaling.maxReplicas }}
19-
{{- with .Values.worker.autoscaling.behavior }}
19+
{{- if .Values.worker.autoscaling.behavior }}
2020
behavior:
21-
{{- with .scaleUp }}
21+
{{- with .Values.worker.autoscaling.behavior.scaleUp }}
2222
scaleUp:
2323
{{- if .stabilizationWindowSeconds }}
2424
stabilizationWindowSeconds: {{ .stabilizationWindowSeconds }}
@@ -35,7 +35,7 @@ spec:
3535
{{- end }}
3636
{{- end }}
3737
{{- end }}
38-
{{- with .scaleDown }}
38+
{{- with .Values.worker.autoscaling.behavior.scaleDown }}
3939
scaleDown:
4040
{{- if .stabilizationWindowSeconds }}
4141
stabilizationWindowSeconds: {{ .stabilizationWindowSeconds }}

charts/netbox/values.schema.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -175,10 +175,10 @@
175175
"type": "integer"
176176
},
177177
"targetCPUUtilizationPercentage": {
178-
"type": "integer"
178+
"type": ["integer", "null"]
179179
},
180180
"targetMemoryUtilizationPercentage": {
181-
"type": "integer"
181+
"type": ["integer", "null"]
182182
},
183183
"behavior": {
184184
"type": "object",
@@ -1530,10 +1530,10 @@
15301530
"type": "integer"
15311531
},
15321532
"targetCPUUtilizationPercentage": {
1533-
"type": "integer"
1533+
"type": ["integer", "null"]
15341534
},
15351535
"targetMemoryUtilizationPercentage": {
1536-
"type": "integer"
1536+
"type": ["integer", "null"]
15371537
},
15381538
"behavior": {
15391539
"type": "object",

charts/netbox/values.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1165,8 +1165,8 @@ autoscaling:
11651165
minReplicas: 1
11661166
maxReplicas: 100
11671167
targetCPUUtilizationPercentage: 80
1168-
# targetMemoryUtilizationPercentage: 80
1169-
# behavior:
1168+
targetMemoryUtilizationPercentage: null
1169+
behavior: {}
11701170
# scaleUp:
11711171
# stabilizationWindowSeconds: 0
11721172
# selectPolicy: Max
@@ -1663,8 +1663,8 @@ worker:
16631663
minReplicas: 1
16641664
maxReplicas: 100
16651665
targetCPUUtilizationPercentage: 80
1666-
# targetMemoryUtilizationPercentage: 80
1667-
# behavior:
1666+
targetMemoryUtilizationPercentage: null
1667+
behavior: {}
16681668
# scaleUp:
16691669
# stabilizationWindowSeconds: 0
16701670
# selectPolicy: Max

0 commit comments

Comments
 (0)