Shad Ansari | 0a4637a | 2022-05-11 12:20:59 -0700 | [diff] [blame^] | 1 | # Copyright 2020-present Open Networking Foundation |
| 2 | # SPDX-License-Identifier: LicenseRef-ONF-Member-Only-1.0 |
| 3 | |
| 4 | {{- if .Values.autoscaling.enabled }} |
| 5 | apiVersion: autoscaling/v2beta1 |
| 6 | kind: HorizontalPodAutoscaler |
| 7 | metadata: |
| 8 | name: {{ include "person-detection-app.fullname" . }} |
| 9 | labels: |
| 10 | {{- include "person-detection-app.labels" . | nindent 4 }} |
| 11 | spec: |
| 12 | scaleTargetRef: |
| 13 | apiVersion: apps/v1 |
| 14 | kind: Deployment |
| 15 | name: {{ include "person-detection-app.fullname" . }} |
| 16 | minReplicas: {{ .Values.autoscaling.minReplicas }} |
| 17 | maxReplicas: {{ .Values.autoscaling.maxReplicas }} |
| 18 | metrics: |
| 19 | {{- if .Values.autoscaling.targetCPUUtilizationPercentage }} |
| 20 | - type: Resource |
| 21 | resource: |
| 22 | name: cpu |
| 23 | targetAverageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }} |
| 24 | {{- end }} |
| 25 | {{- if .Values.autoscaling.targetMemoryUtilizationPercentage }} |
| 26 | - type: Resource |
| 27 | resource: |
| 28 | name: memory |
| 29 | targetAverageUtilization: {{ .Values.autoscaling.targetMemoryUtilizationPercentage }} |
| 30 | {{- end }} |
| 31 | {{- end }} |