Skip to content

Commit f6c5fc4

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

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",
@@ -1539,10 +1539,10 @@
15391539
"type": "integer"
15401540
},
15411541
"targetCPUUtilizationPercentage": {
1542-
"type": "integer"
1542+
"type": ["integer", "null"]
15431543
},
15441544
"targetMemoryUtilizationPercentage": {
1545-
"type": "integer"
1545+
"type": ["integer", "null"]
15461546
},
15471547
"behavior": {
15481548
"type": "object",

charts/netbox/values.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1178,8 +1178,8 @@ autoscaling:
11781178
minReplicas: 1
11791179
maxReplicas: 100
11801180
targetCPUUtilizationPercentage: 80
1181-
# targetMemoryUtilizationPercentage: 80
1182-
# behavior:
1181+
targetMemoryUtilizationPercentage: null
1182+
behavior: {}
11831183
# scaleUp:
11841184
# stabilizationWindowSeconds: 0
11851185
# selectPolicy: Max
@@ -1687,8 +1687,8 @@ worker:
16871687
minReplicas: 1
16881688
maxReplicas: 100
16891689
targetCPUUtilizationPercentage: 80
1690-
# targetMemoryUtilizationPercentage: 80
1691-
# behavior:
1690+
targetMemoryUtilizationPercentage: null
1691+
behavior: {}
16921692
# scaleUp:
16931693
# stabilizationWindowSeconds: 0
16941694
# selectPolicy: Max

0 commit comments

Comments
 (0)