blob: 79595e226aa1415bf7bfc59a700f6511cbabbbbc [file] [log] [blame]
Hyunsun Moon97e111d2022-05-13 17:56:56 -07001{{/*
2# Copyright 2022-present Open Networking Foundation
3
4# SPDX-License-Identifier: Apache-2.0
5*/}}
Shad Ansari0a4637a2022-05-11 12:20:59 -07006
7{{- if .Values.autoscaling.enabled }}
8apiVersion: autoscaling/v2beta1
9kind: HorizontalPodAutoscaler
10metadata:
11 name: {{ include "person-detection-app.fullname" . }}
12 labels:
13 {{- include "person-detection-app.labels" . | nindent 4 }}
14spec:
15 scaleTargetRef:
16 apiVersion: apps/v1
17 kind: Deployment
18 name: {{ include "person-detection-app.fullname" . }}
19 minReplicas: {{ .Values.autoscaling.minReplicas }}
20 maxReplicas: {{ .Values.autoscaling.maxReplicas }}
21 metrics:
22 {{- if .Values.autoscaling.targetCPUUtilizationPercentage }}
23 - type: Resource
24 resource:
25 name: cpu
26 targetAverageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }}
27 {{- end }}
28 {{- if .Values.autoscaling.targetMemoryUtilizationPercentage }}
29 - type: Resource
30 resource:
31 name: memory
32 targetAverageUtilization: {{ .Values.autoscaling.targetMemoryUtilizationPercentage }}
33 {{- end }}
34{{- end }}