| Sketch🕴️ | 620d57b | 2025-07-31 22:31:14 +0400 | [diff] [blame] | 1 | {{- /* |
| 2 | Copyright Broadcom, Inc. All Rights Reserved. |
| 3 | SPDX-License-Identifier: APACHE-2.0 |
| 4 | */}} |
| 5 | |
| 6 | {{- if .Values.autoscaling.enabled }} |
| 7 | apiVersion: {{ include "common.capabilities.hpa.apiVersion" ( dict "context" $ ) }} |
| 8 | kind: HorizontalPodAutoscaler |
| 9 | metadata: |
| 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 }} |
| 16 | spec: |
| 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 }} |