hpa.yaml 1.6 KB

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