blob: 3ee2f7e8c83473dbd6f35b94c01f2f7e9c356f87 [file] [log] [blame]
Shad Ansari0a4637a2022-05-11 12:20:59 -07001# Copyright 2020-present Open Networking Foundation
2# SPDX-License-Identifier: LicenseRef-ONF-Member-Only-1.0
3
4{{- if .Values.autoscaling.enabled }}
5apiVersion: autoscaling/v2beta1
6kind: HorizontalPodAutoscaler
7metadata:
8 name: {{ include "person-detection-app.fullname" . }}
9 labels:
10 {{- include "person-detection-app.labels" . | nindent 4 }}
11spec:
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 }}