feat(argo-cd): Added apiVersion switch for autoscaling resources (#1375)
* Added apiVersion switch for autoscaling Signed-off-by: dn <dn@nuvotex.de> * bumped chart version added changelog Signed-off-by: dn <dn@nuvotex.de> * updated docs with helm-docs 1.9.1 Signed-off-by: dn <dn@nuvotex.de> * added new line end of file (lint issue) Signed-off-by: dn <dn@nuvotex.de> * replaced linebreaks in chart.yaml with LF Signed-off-by: dn <dn@nuvotex.de> * Apply changes from code review Signed-off-by: Marco Kilchhofer <mkilchhofer@users.noreply.github.com> Co-authored-by: Marco Kilchhofer <mkilchhofer@users.noreply.github.com>
This commit is contained in:
parent
1fda562239
commit
9c245d4e65
6 changed files with 44 additions and 4 deletions
|
|
@ -219,6 +219,19 @@ Return the appropriate apiVersion for ingress
|
|||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Return the appropriate apiVersion for autoscaling
|
||||
*/}}
|
||||
{{- define "argo-cd.autoscaling.apiVersion" -}}
|
||||
{{- if .Values.apiVersionOverrides.autoscaling -}}
|
||||
{{- print .Values.apiVersionOverrides.autoscaling -}}
|
||||
{{- else if semverCompare "<1.23-0" (include "argo-cd.kubeVersion" $) -}}
|
||||
{{- print "autoscaling/v2beta1" -}}
|
||||
{{- else -}}
|
||||
{{- print "autoscaling/v2" -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Return the target Kubernetes version
|
||||
*/}}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
{{- if .Values.repoServer.autoscaling.enabled }}
|
||||
apiVersion: autoscaling/v2beta1
|
||||
apiVersion: {{ include "argo-cd.autoscaling.apiVersion" . }}
|
||||
kind: HorizontalPodAutoscaler
|
||||
metadata:
|
||||
labels:
|
||||
|
|
@ -17,12 +17,24 @@ spec:
|
|||
- type: Resource
|
||||
resource:
|
||||
name: memory
|
||||
{{- if eq (include "argo-cd.autoscaling.apiVersion" $) "autoscaling/v2beta1" }}
|
||||
targetAverageUtilization: {{ . }}
|
||||
{{- else }}
|
||||
target:
|
||||
averageUtilization: {{ . }}
|
||||
type: Utilization
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- with .Values.repoServer.autoscaling.targetCPUUtilizationPercentage }}
|
||||
- type: Resource
|
||||
resource:
|
||||
name: cpu
|
||||
{{- if eq (include "argo-cd.autoscaling.apiVersion" $) "autoscaling/v2beta1" }}
|
||||
targetAverageUtilization: {{ . }}
|
||||
{{- else }}
|
||||
target:
|
||||
averageUtilization: {{ . }}
|
||||
type: Utilization
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
{{- if .Values.server.autoscaling.enabled }}
|
||||
apiVersion: autoscaling/v2beta1
|
||||
apiVersion: {{ include "argo-cd.autoscaling.apiVersion" . }}
|
||||
kind: HorizontalPodAutoscaler
|
||||
metadata:
|
||||
labels:
|
||||
|
|
@ -17,12 +17,24 @@ spec:
|
|||
- type: Resource
|
||||
resource:
|
||||
name: memory
|
||||
{{- if eq (include "argo-cd.autoscaling.apiVersion" $) "autoscaling/v2beta1" }}
|
||||
targetAverageUtilization: {{ . }}
|
||||
{{- else }}
|
||||
target:
|
||||
averageUtilization: {{ . }}
|
||||
type: Utilization
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- with .Values.server.autoscaling.targetCPUUtilizationPercentage }}
|
||||
- type: Resource
|
||||
resource:
|
||||
name: cpu
|
||||
{{- if eq (include "argo-cd.autoscaling.apiVersion" $) "autoscaling/v2beta1" }}
|
||||
targetAverageUtilization: {{ . }}
|
||||
{{- else }}
|
||||
target:
|
||||
averageUtilization: {{ . }}
|
||||
type: Utilization
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue