Skip to content

Commit 679c4b4

Browse files
authored
dev: add hpa (#15)
1 parent b0a1d8a commit 679c4b4

File tree

3 files changed

+16
-12
lines changed

3 files changed

+16
-12
lines changed

cr.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ charts-dir: squadcast-helm
55
sign: false
66
charts_repo_url: https://squadcasthub.github.io/helm-infra
77
index-path: .
8-
version: 0.2.4
8+
version: 0.2.5

squadcast-helm/Chart.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@ name: squadcast-helm
33
description: A Helm chart for Kubernetes
44
type: application
55

6-
version: 0.2.4
6+
version: 0.2.5
77

88
appVersion: "1.16.0"

squadcast-helm/templates/hpa.yaml

+14-10
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,34 @@
11
{{- if .Values.autoscaling.enabled }}
2-
apiVersion: autoscaling/v2beta1
2+
apiVersion: autoscaling/v2
33
kind: HorizontalPodAutoscaler
44
metadata:
5-
name: {{ include "squadcast-helm.fullname" . }}
6-
labels:
5+
name: {{ include "squadcast-helm.fullname" . }}
6+
labels:
77
{{- include "squadcast-helm.labels" . | nindent 4 }}
8-
namespace: {{ .Values.namespace }}
8+
namespace: {{ .Values.namespace }}
99

1010
spec:
11-
scaleTargetRef:
11+
scaleTargetRef:
1212
apiVersion: apps/v1
1313
kind: Deployment
1414
name: {{ include "squadcast-helm.fullname" . }}
15-
minReplicas: {{ .Values.autoscaling.minReplicas }}
16-
maxReplicas: {{ .Values.autoscaling.maxReplicas }}
17-
metrics:
15+
minReplicas: {{ .Values.autoscaling.minReplicas }}
16+
maxReplicas: {{ .Values.autoscaling.maxReplicas }}
17+
metrics:
1818
{{- if .Values.autoscaling.targetCPUUtilizationPercentage }}
1919
- type: Resource
2020
resource:
2121
name: cpu
22-
targetAverageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }}
22+
target:
23+
type: Utilization
24+
averageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }}
2325
{{- end }}
2426
{{- if .Values.autoscaling.targetMemoryUtilizationPercentage }}
2527
- type: Resource
2628
resource:
2729
name: memory
28-
targetAverageUtilization: {{ .Values.autoscaling.targetMemoryUtilizationPercentage }}
30+
target:
31+
type: Utilization
32+
averageUtilization: {{ .Values.autoscaling.targetMemoryUtilizationPercentage }}
2933
{{- end }}
3034
{{- end }}

0 commit comments

Comments
 (0)