hpa.yaml 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. {{- if .Values.querier.autoscaling.enabled }}
  2. {{- $apiVersion := include "tempo.hpa.apiVersion" . -}}
  3. apiVersion: {{ $apiVersion }}
  4. kind: HorizontalPodAutoscaler
  5. metadata:
  6. name: {{ include "tempo.resourceName" (dict "ctx" . "component" "querier") }}
  7. labels:
  8. {{- include "tempo.labels" (dict "ctx" . "component" "querier") | nindent 4 }}
  9. spec:
  10. scaleTargetRef:
  11. apiVersion: apps/v1
  12. kind: Deployment
  13. name: {{ include "tempo.resourceName" (dict "ctx" . "component" "querier") }}
  14. minReplicas: {{ .Values.querier.autoscaling.minReplicas }}
  15. maxReplicas: {{ .Values.querier.autoscaling.maxReplicas }}
  16. {{- with .Values.querier.autoscaling.behavior }}
  17. behavior:
  18. {{- toYaml . | nindent 4 }}
  19. {{- end }}
  20. metrics:
  21. {{- with .Values.querier.autoscaling.targetMemoryUtilizationPercentage }}
  22. - type: Resource
  23. resource:
  24. name: memory
  25. {{- if (eq $apiVersion "autoscaling/v2") }}
  26. target:
  27. type: Utilization
  28. averageUtilization: {{ . }}
  29. {{- else }}
  30. targetAverageUtilization: {{ . }}
  31. {{- end }}
  32. {{- end }}
  33. {{- with .Values.querier.autoscaling.targetCPUUtilizationPercentage }}
  34. - type: Resource
  35. resource:
  36. name: cpu
  37. {{- if (eq $apiVersion "autoscaling/v2") }}
  38. target:
  39. type: Utilization
  40. averageUtilization: {{ . }}
  41. {{- else }}
  42. targetAverageUtilization: {{ . }}
  43. {{- end }}
  44. {{- end }}
  45. {{- end }}