| Giorgi Lekveishvili | 725bb39 | 2023-05-05 18:24:27 +0400 | [diff] [blame] | 1 | {{- if and .Values.defaultBackend.enabled .Values.defaultBackend.autoscaling.enabled }} |
| Giorgi Lekveishvili | cccf72f | 2023-05-19 16:13:22 +0400 | [diff] [blame] | 2 | apiVersion: {{ .Values.defaultBackend.autoscaling.apiVersion }} |
| Giorgi Lekveishvili | 725bb39 | 2023-05-05 18:24:27 +0400 | [diff] [blame] | 3 | kind: HorizontalPodAutoscaler |
| 4 | metadata: |
| 5 | labels: |
| 6 | {{- include "ingress-nginx.labels" . | nindent 4 }} |
| 7 | app.kubernetes.io/component: default-backend |
| Giorgi Lekveishvili | cccf72f | 2023-05-19 16:13:22 +0400 | [diff] [blame] | 8 | {{- with .Values.defaultBackend.labels }} |
| 9 | {{- toYaml . | nindent 4 }} |
| 10 | {{- end }} |
| Giorgi Lekveishvili | 725bb39 | 2023-05-05 18:24:27 +0400 | [diff] [blame] | 11 | name: {{ template "ingress-nginx.defaultBackend.fullname" . }} |
| 12 | namespace: {{ .Release.Namespace }} |
| 13 | spec: |
| 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 Lekveishvili | cccf72f | 2023-05-19 16:13:22 +0400 | [diff] [blame] | 25 | target: |
| 26 | type: Utilization |
| 27 | averageUtilization: {{ . }} |
| Giorgi Lekveishvili | 725bb39 | 2023-05-05 18:24:27 +0400 | [diff] [blame] | 28 | {{- end }} |
| 29 | {{- with .Values.defaultBackend.autoscaling.targetMemoryUtilizationPercentage }} |
| 30 | - type: Resource |
| 31 | resource: |
| 32 | name: memory |
| Giorgi Lekveishvili | cccf72f | 2023-05-19 16:13:22 +0400 | [diff] [blame] | 33 | target: |
| 34 | type: Utilization |
| 35 | averageUtilization: {{ . }} |
| Giorgi Lekveishvili | 725bb39 | 2023-05-05 18:24:27 +0400 | [diff] [blame] | 36 | {{- end }} |
| 37 | {{- end }} |