Keine Beschreibung

frontend-hpa.yaml 1.8KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. {{- if .Values.frontend.autoscaling.hpa.enabled }}
  2. apiVersion: {{ include "common.capabilities.hpa.apiVersion" . }}
  3. kind: HorizontalPodAutoscaler
  4. metadata:
  5. name: {{ include "shuffle.frontend.name" . }}
  6. namespace: {{ include "common.names.namespace" . | quote }}
  7. labels: {{- include "shuffle.frontend.labels" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }}
  8. {{- if .Values.commonAnnotations }}
  9. annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
  10. {{- end }}
  11. spec:
  12. scaleTargetRef:
  13. apiVersion: {{ include "common.capabilities.deployment.apiVersion" . }}
  14. kind: Deployment
  15. name: {{ include "shuffle.frontend.name" . }}
  16. minReplicas: {{ .Values.frontend.autoscaling.hpa.minReplicas }}
  17. maxReplicas: {{ .Values.frontend.autoscaling.hpa.maxReplicas }}
  18. metrics:
  19. {{- if .Values.frontend.autoscaling.hpa.targetMemory }}
  20. - type: Resource
  21. resource:
  22. name: memory
  23. {{- if semverCompare "<1.23-0" (include "common.capabilities.kubeVersion" .) }}
  24. targetAverageUtilization: {{ .Values.frontend.autoscaling.hpa.targetMemory }}
  25. {{- else }}
  26. target:
  27. type: Utilization
  28. averageUtilization: {{ .Values.worker.autoscaling.hpa.targetMemory }}
  29. {{- end }}
  30. {{- end }}
  31. {{- if .Values.frontend.autoscaling.hpa.targetCPU }}
  32. - type: Resource
  33. resource:
  34. name: cpu
  35. {{- if semverCompare "<1.23-0" (include "common.capabilities.kubeVersion" .) }}
  36. targetAverageUtilization: {{ .Values.frontend.autoscaling.hpa.targetCPU }}
  37. {{- else }}
  38. target:
  39. type: Utilization
  40. averageUtilization: {{ .Values.worker.autoscaling.hpa.targetCPU }}
  41. {{- end }}
  42. {{- end }}
  43. {{- end }}