fix kubeval (#2505)
* fix kubeval * fix kubeval * fix kubeval * fix issue with hpa * fix version to 1.24.0 * fix 1.25
This commit is contained in:
parent
ee92ea47cb
commit
df2b2e01de
1 changed files with 18 additions and 0 deletions
|
@ -1,5 +1,11 @@
|
||||||
{{- if .Values.autoscaling.enabled }}
|
{{- if .Values.autoscaling.enabled }}
|
||||||
|
{{- $kubeCapabilityVersion := semver .Capabilities.KubeVersion.Version -}}
|
||||||
|
{{- $isHigher1p25 := ge (semver "1.25" | $kubeCapabilityVersion.Compare) 0 -}}
|
||||||
|
{{- if and ($.Capabilities.APIVersions.Has "autoscaling/v2") $isHigher1p25 -}}
|
||||||
|
apiVersion: autoscaling/v2
|
||||||
|
{{- else }}
|
||||||
apiVersion: autoscaling/v2beta1
|
apiVersion: autoscaling/v2beta1
|
||||||
|
{{- end }}
|
||||||
kind: HorizontalPodAutoscaler
|
kind: HorizontalPodAutoscaler
|
||||||
metadata:
|
metadata:
|
||||||
name: {{ include "kafka-ui.fullname" . }}
|
name: {{ include "kafka-ui.fullname" . }}
|
||||||
|
@ -17,12 +23,24 @@ spec:
|
||||||
- type: Resource
|
- type: Resource
|
||||||
resource:
|
resource:
|
||||||
name: cpu
|
name: cpu
|
||||||
|
{{- if $isHigher1p25 }}
|
||||||
|
target:
|
||||||
|
type: Utilization
|
||||||
|
averageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }}
|
||||||
|
{{- else }}
|
||||||
targetAverageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }}
|
targetAverageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
{{- if .Values.autoscaling.targetMemoryUtilizationPercentage }}
|
{{- if .Values.autoscaling.targetMemoryUtilizationPercentage }}
|
||||||
- type: Resource
|
- type: Resource
|
||||||
resource:
|
resource:
|
||||||
name: memory
|
name: memory
|
||||||
|
{{- if $isHigher1p25 }}
|
||||||
|
target:
|
||||||
|
type: Utilization
|
||||||
|
averageUtilization: {{ .Values.autoscaling.targetMemoryUtilizationPercentage }}
|
||||||
|
{{- else }}
|
||||||
targetAverageUtilization: {{ .Values.autoscaling.targetMemoryUtilizationPercentage }}
|
targetAverageUtilization: {{ .Values.autoscaling.targetMemoryUtilizationPercentage }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
|
Loading…
Add table
Reference in a new issue