You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

28 lines
911 B

  1. {{- if .Values.autoscaling.enabled }}
  2. apiVersion: autoscaling/v2beta1
  3. kind: HorizontalPodAutoscaler
  4. metadata:
  5. name: {{ include "mastodon.fullname" . }}
  6. labels:
  7. {{- include "mastodon.labels" . | nindent 4 }}
  8. spec:
  9. scaleTargetRef:
  10. apiVersion: apps/v1
  11. kind: Deployment
  12. name: {{ include "mastodon.fullname" . }}
  13. minReplicas: {{ .Values.autoscaling.minReplicas }}
  14. maxReplicas: {{ .Values.autoscaling.maxReplicas }}
  15. metrics:
  16. {{- if .Values.autoscaling.targetCPUUtilizationPercentage }}
  17. - type: Resource
  18. resource:
  19. name: cpu
  20. targetAverageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }}
  21. {{- end }}
  22. {{- if .Values.autoscaling.targetMemoryUtilizationPercentage }}
  23. - type: Resource
  24. resource:
  25. name: memory
  26. targetAverageUtilization: {{ .Values.autoscaling.targetMemoryUtilizationPercentage }}
  27. {{- end }}
  28. {{- end }}