Merge "[AAI] Add model-loader tracing config"
[oom.git] / kubernetes / portal-ng / components / portal-ng-bff / templates / hpa.yaml
1 {{- if .Values.autoscaling.enabled }}
2 apiVersion: autoscaling/v2beta1
3 kind: HorizontalPodAutoscaler
4 metadata:
5   name: {{ include "common.fullname" . }}
6   namespace: {{ include "common.namespace" . }}
7   labels:
8     app: {{ include "common.name" . }}
9     chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
10     release: {{ include "common.release" . }}
11     heritage: {{ .Release.Service }}
12 spec:
13   scaleTargetRef:
14     apiVersion: apps/v1
15     kind: Deployment
16     name: {{ include "common.fullname" . }}
17   minReplicas: {{ .Values.autoscaling.minReplicas }}
18   maxReplicas: {{ .Values.autoscaling.maxReplicas }}
19   metrics:
20     {{- if .Values.autoscaling.targetCPUUtilizationPercentage }}
21     - type: Resource
22       resource:
23         name: cpu
24         targetAverageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }}
25     {{- end }}
26     {{- if .Values.autoscaling.targetMemoryUtilizationPercentage }}
27     - type: Resource
28       resource:
29         name: memory
30         targetAverageUtilization: {{ .Values.autoscaling.targetMemoryUtilizationPercentage }}
31     {{- end }}
32 {{- end }}