{{- if .Values.ingester.autoscaling.enabled }} {{- $apiVersion := include "tempo.hpa.apiVersion" . -}} apiVersion: {{ $apiVersion }} kind: HorizontalPodAutoscaler metadata: name: {{ include "tempo.resourceName" (dict "ctx" . "component" "ingester") }} labels: {{- include "tempo.labels" (dict "ctx" . "component" "ingester") | nindent 4 }} spec: scaleTargetRef: apiVersion: apps/v1 kind: StatefulSet name: {{ include "tempo.resourceName" (dict "ctx" . "component" "ingester") }} minReplicas: {{ .Values.ingester.autoscaling.minReplicas }} maxReplicas: {{ .Values.ingester.autoscaling.maxReplicas }} {{- with .Values.ingester.autoscaling.behavior }} behavior: {{- toYaml . | nindent 4 }} {{- end }} metrics: {{- with .Values.ingester.autoscaling.targetMemoryUtilizationPercentage }} - type: Resource resource: name: memory {{- if (eq $apiVersion "autoscaling/v2") }} target: type: Utilization averageUtilization: {{ . }} {{- else }} targetAverageUtilization: {{ . }} {{- end }} {{- end }} {{- with .Values.ingester.autoscaling.targetCPUUtilizationPercentage }} - type: Resource resource: name: cpu {{- if (eq $apiVersion "autoscaling/v2") }} target: type: Utilization averageUtilization: {{ . }} {{- else }} targetAverageUtilization: {{ . }} {{- end }} {{- end }} {{- end }}