This commit is contained in:
titver968
2025-03-04 16:01:10 +01:00
parent 9f77e6a4cd
commit 7857402f95
3 changed files with 15 additions and 28 deletions

View File

@@ -1,32 +1,19 @@
{{- if .Values.autoscaling.enabled }}
apiVersion: autoscaling/v2
{{- if .Values.autoscaling.enabled -}}
apiVersion: autoscaling/v1
kind: HorizontalPodAutoscaler
metadata:
name: {{ include "tatort.fullname" . }}
name: {{ template "tatort.fullname" . }}
labels:
{{- include "tatort.labels" . | nindent 4 }}
app: {{ template "tatort.name" . }}
chart: {{ template "tatort.chart" . }}
component: tatort
heritage: {{ .Release.Service }}
release: {{ .Release.Name }}
spec:
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: {{ include "tatort.fullname" . }}
minReplicas: {{ .Values.autoscaling.minReplicas }}
maxReplicas: {{ .Values.autoscaling.maxReplicas }}
metrics:
{{- if .Values.autoscaling.targetCPUUtilizationPercentage }}
- type: Resource
resource:
name: cpu
target:
type: Utilization
averageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }}
{{- end }}
{{- if .Values.autoscaling.targetMemoryUtilizationPercentage }}
- type: Resource
resource:
name: memory
target:
type: Utilization
averageUtilization: {{ .Values.autoscaling.targetMemoryUtilizationPercentage }}
{{- end }}
{{- end }}
name: {{ template "tatort.fullname" . }}
{{ toYaml .Values.autoscaling.config | indent 2 }}
{{- end -}}