File tree 1 file changed +13
-1
lines changed
1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change 1
1
{{- if .Values.autoscaling.enabled }}
2
- apiVersion : autoscaling/v2beta1
2
+ apiVersion : {{ ternary " autoscaling/v2" "autoscaling/ v2beta1" (.Capabilities.APIVersions.Has "autoscaling/v2") }}
3
3
kind : HorizontalPodAutoscaler
4
4
metadata :
5
5
name : {{ include "kminion.fullname" . }}
@@ -18,12 +18,24 @@ spec:
18
18
- type : Resource
19
19
resource :
20
20
name : cpu
21
+ {{- if .Capabilities.APIVersions.Has "autoscaling/v2" }}
22
+ target :
23
+ type : Utilization
24
+ averageUtilization : {{ .Values.autoscaling.targetCPUUtilizationPercentage }}
25
+ {{ else }}
21
26
targetAverageUtilization : {{ .Values.autoscaling.targetCPUUtilizationPercentage }}
27
+ {{- end }}
22
28
{{- end }}
23
29
{{- if .Values.autoscaling.targetMemoryUtilizationPercentage }}
24
30
- type : Resource
25
31
resource :
26
32
name : memory
33
+ {{- if .Capabilities.APIVersions.Has "autoscaling/v2" }}
34
+ target :
35
+ type : Utilization
36
+ averageUtilization : {{ .Values.autoscaling.targetCPUUtilizationPercentage }}
37
+ {{ else }}
27
38
targetAverageUtilization : {{ .Values.autoscaling.targetMemoryUtilizationPercentage }}
39
+ {{- end }}
28
40
{{- end }}
29
41
{{- end }}
You can’t perform that action at this time.
0 commit comments