blob: aa6613875712abf3d921b19d97ff8d8939b5b69b [file] [log] [blame]
Mohammed Naser8a2c8fb2023-02-19 17:23:55 +00001{{- if or (eq .Values.role "Aggregator") (eq .Values.role "Stateless-Aggregator") -}}
2{{- if .Values.autoscaling.enabled }}
3apiVersion: {{ template "autoscaling.apiVersion" . }}
4kind: HorizontalPodAutoscaler
5metadata:
6 name: {{ include "vector.fullname" . }}
7 labels:
8 {{- include "vector.labels" . | nindent 4 }}
Giovanni Tirloni59219b62024-04-09 14:50:25 -03009 annotations:
10 {{- toYaml .Values.autoscaling.annotations | nindent 4 }}
Mohammed Naser8a2c8fb2023-02-19 17:23:55 +000011spec:
12 scaleTargetRef:
13 apiVersion: apps/v1
14 {{- if (eq .Values.role "Aggregator") }}
15 kind: StatefulSet
16 {{- else if (eq .Values.role "Stateless-Aggregator") }}
17 kind: Deployment
18 {{- end }}
19 name: {{ include "vector.fullname" . }}
20 minReplicas: {{ .Values.autoscaling.minReplicas }}
21 maxReplicas: {{ .Values.autoscaling.maxReplicas }}
22 metrics:
23 {{- if .Values.autoscaling.targetMemoryUtilizationPercentage }}
24 - type: Resource
25 resource:
26 name: memory
27 target:
28 type: Utilization
29 averageUtilization: {{ .Values.autoscaling.targetMemoryUtilizationPercentage }}
30 {{- end }}
31 {{- if .Values.autoscaling.targetCPUUtilizationPercentage }}
32 - type: Resource
33 resource:
34 name: cpu
35 target:
36 type: Utilization
37 averageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }}
38 {{- end }}
39 {{- with .Values.autoscaling.customMetric -}}
40 {{ toYaml . | nindent 4 }}
41 {{- end }}
42 {{- with .Values.autoscaling.behavior }}
43 behavior:
44 {{- toYaml . | nindent 4 }}
45 {{- end }}
46{{- end }}
47{{- end }}