Commit 7f64544 1 parent e400850 commit 7f64544 Copy full SHA for 7f64544
File tree 1 file changed +18
-0
lines changed
1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change 1
1
{{- if not .Values.useStatefulset.enabled -}}
2
2
{{- if .Values.autoscaling.enabled }}
3
+ {{- if .Capabilities.APIVersions.Has "autoscaling/v2" }}
4
+ apiVersion : autoscaling/v2
5
+ {{- else if .Capabilities.APIVersions.Has "autoscaling/v2beta2" }}
6
+ apiVersion : autoscaling/v2beta2
7
+ {{- else }}
3
8
apiVersion : autoscaling/v2beta1
9
+ {{- end }}
4
10
kind : HorizontalPodAutoscaler
5
11
metadata :
6
12
name : {{ include "kube-httpcache.fullname" . }}
@@ -18,13 +24,25 @@ spec:
18
24
- type : Resource
19
25
resource :
20
26
name : cpu
27
+ {{- if or (.Capabilities.APIVersions.Has "autoscaling/v2") (.Capabilities.APIVersions.Has "autoscaling/v2beta2") }}
28
+ target :
29
+ type : Utilization
30
+ averageUtilization : {{ .Values.autoscaling.targetCPUUtilizationPercentage }}
31
+ {{- else }}
21
32
targetAverageUtilization : {{ .Values.autoscaling.targetCPUUtilizationPercentage }}
33
+ {{- end }}
22
34
{{- end }}
23
35
{{- if .Values.autoscaling.targetMemoryUtilizationPercentage }}
24
36
- type : Resource
25
37
resource :
26
38
name : memory
39
+ {{- if or (.Capabilities.APIVersions.Has "autoscaling/v2") (.Capabilities.APIVersions.Has "autoscaling/v2beta2") }}
40
+ target :
41
+ type : Utilization
42
+ averageUtilization : {{ .Values.autoscaling.targetMemoryUtilizationPercentage }}
43
+ {{- else }}
27
44
targetAverageUtilization : {{ .Values.autoscaling.targetMemoryUtilizationPercentage }}
45
+ {{- end }}
28
46
{{- end }}
29
47
{{- end }}
30
48
{{- end }}
You can’t perform that action at this time.
0 commit comments