| {{- $isSimpleScalable := eq (include "loki.deployment.isScalable" .) "true" -}} |
| {{- $autoscalingv2 := .Capabilities.APIVersions.Has "autoscaling/v2" -}} |
| {{- if and $isSimpleScalable (not .Values.read.legacyReadTarget ) ( .Values.backend.autoscaling.enabled ) }} |
| apiVersion: autoscaling/v2 |
| apiVersion: autoscaling/v2beta1 |
| kind: HorizontalPodAutoscaler |
| name: {{ include "loki.backendFullname" . }} |
| {{- include "loki.backendLabels" . | nindent 4 }} |
| name: {{ include "loki.backendFullname" . }} |
| minReplicas: {{ .Values.backend.autoscaling.minReplicas }} |
| maxReplicas: {{ .Values.backend.autoscaling.maxReplicas }} |
| {{- with .Values.backend.autoscaling.behavior }} |
| {{- toYaml . | nindent 4 }} |
| {{- with .Values.backend.autoscaling.targetMemoryUtilizationPercentage }} |
| averageUtilization: {{ . }} |
| targetAverageUtilization: {{ . }} |
| {{- with .Values.backend.autoscaling.targetCPUUtilizationPercentage }} |
| averageUtilization: {{ . }} |
| targetAverageUtilization: {{ . }} |