2022-11-10 23:24:39 +01:00
|
|
|
{{- if .Values.autoscaling.enabled -}}
|
2020-06-29 13:58:48 +02:00
|
|
|
apiVersion: autoscaling/v2beta1
|
|
|
|
kind: HorizontalPodAutoscaler
|
|
|
|
metadata:
|
|
|
|
name: {{ include "mastodon.fullname" . }}
|
|
|
|
labels:
|
|
|
|
{{- include "mastodon.labels" . | nindent 4 }}
|
|
|
|
spec:
|
|
|
|
scaleTargetRef:
|
|
|
|
apiVersion: apps/v1
|
|
|
|
kind: Deployment
|
|
|
|
name: {{ include "mastodon.fullname" . }}
|
|
|
|
minReplicas: {{ .Values.autoscaling.minReplicas }}
|
|
|
|
maxReplicas: {{ .Values.autoscaling.maxReplicas }}
|
|
|
|
metrics:
|
2022-11-10 23:24:39 +01:00
|
|
|
{{- if .Values.autoscaling.targetCPUUtilizationPercentage }}
|
2020-06-29 13:58:48 +02:00
|
|
|
- type: Resource
|
|
|
|
resource:
|
|
|
|
name: cpu
|
|
|
|
targetAverageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }}
|
2022-11-10 23:24:39 +01:00
|
|
|
{{- end }}
|
|
|
|
{{- if .Values.autoscaling.targetMemoryUtilizationPercentage }}
|
2020-06-29 13:58:48 +02:00
|
|
|
- type: Resource
|
|
|
|
resource:
|
|
|
|
name: memory
|
|
|
|
targetAverageUtilization: {{ .Values.autoscaling.targetMemoryUtilizationPercentage }}
|
2022-11-10 23:24:39 +01:00
|
|
|
{{- end }}
|
2020-06-29 13:58:48 +02:00
|
|
|
{{- end }}
|