blob: e88e2023d69e9352e30712e4f3b490246d8b2ae1 [file] [log] [blame]
Sketch🕴️620d57b2025-07-31 22:31:14 +04001{{- /*
2Copyright Broadcom, Inc. All Rights Reserved.
3SPDX-License-Identifier: APACHE-2.0
4*/}}
5
6{{- if .Values.autoscaling.enabled }}
7apiVersion: {{ include "common.capabilities.hpa.apiVersion" ( dict "context" $ ) }}
8kind: HorizontalPodAutoscaler
9metadata:
10 name: {{ template "common.names.fullname" . }}
11 namespace: {{ include "common.names.namespace" . | quote }}
12 labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }}
13 {{- if .Values.commonAnnotations }}
14 annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
15 {{- end }}
16spec:
17 scaleTargetRef:
18 apiVersion: {{ include "common.capabilities.deployment.apiVersion" . }}
19 kind: Deployment
20 name: {{ template "common.names.fullname" . }}
21 minReplicas: {{ .Values.autoscaling.minReplicas }}
22 maxReplicas: {{ .Values.autoscaling.maxReplicas }}
23 metrics:
24 {{- if .Values.autoscaling.targetMemory }}
25 - type: Resource
26 resource:
27 name: memory
28 target:
29 type: Utilization
30 averageUtilization: {{ .Values.autoscaling.targetMemory }}
31 {{- end }}
32 {{- if .Values.autoscaling.targetCPU }}
33 - type: Resource
34 resource:
35 name: cpu
36 target:
37 type: Utilization
38 averageUtilization: {{ .Values.autoscaling.targetCPU }}
39 {{- end }}
40{{- end }}