blob: 924125f079466b77ef0508c5befc43d2b21c962d [file] [log] [blame]
Giorgi Lekveishvili725bb392023-05-05 18:24:27 +04001{{- if and .Values.defaultBackend.enabled .Values.defaultBackend.autoscaling.enabled }}
Giorgi Lekveishvilicccf72f2023-05-19 16:13:22 +04002apiVersion: {{ .Values.defaultBackend.autoscaling.apiVersion }}
Giorgi Lekveishvili725bb392023-05-05 18:24:27 +04003kind: HorizontalPodAutoscaler
4metadata:
5 labels:
6 {{- include "ingress-nginx.labels" . | nindent 4 }}
7 app.kubernetes.io/component: default-backend
Giorgi Lekveishvilicccf72f2023-05-19 16:13:22 +04008 {{- with .Values.defaultBackend.labels }}
9 {{- toYaml . | nindent 4 }}
10 {{- end }}
Giorgi Lekveishvili725bb392023-05-05 18:24:27 +040011 name: {{ template "ingress-nginx.defaultBackend.fullname" . }}
12 namespace: {{ .Release.Namespace }}
13spec:
14 scaleTargetRef:
15 apiVersion: apps/v1
16 kind: Deployment
17 name: {{ template "ingress-nginx.defaultBackend.fullname" . }}
18 minReplicas: {{ .Values.defaultBackend.autoscaling.minReplicas }}
19 maxReplicas: {{ .Values.defaultBackend.autoscaling.maxReplicas }}
20 metrics:
21{{- with .Values.defaultBackend.autoscaling.targetCPUUtilizationPercentage }}
22 - type: Resource
23 resource:
24 name: cpu
Giorgi Lekveishvilicccf72f2023-05-19 16:13:22 +040025 target:
26 type: Utilization
27 averageUtilization: {{ . }}
Giorgi Lekveishvili725bb392023-05-05 18:24:27 +040028{{- end }}
29{{- with .Values.defaultBackend.autoscaling.targetMemoryUtilizationPercentage }}
30 - type: Resource
31 resource:
32 name: memory
Giorgi Lekveishvilicccf72f2023-05-19 16:13:22 +040033 target:
34 type: Utilization
35 averageUtilization: {{ . }}
Giorgi Lekveishvili725bb392023-05-05 18:24:27 +040036{{- end }}
37{{- end }}