2022-11-11 09:24:39 +11:00
|
|
|
{{- if .Values.autoscaling.enabled -}}
|
2020-06-29 21:58:48 +10: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-11 09:24:39 +11:00
|
|
|
{{- if .Values.autoscaling.targetCPUUtilizationPercentage }}
|
2020-06-29 21:58:48 +10:00
|
|
|
- type: Resource
|
|
|
|
resource:
|
|
|
|
name: cpu
|
|
|
|
targetAverageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }}
|
2022-11-11 09:24:39 +11:00
|
|
|
{{- end }}
|
|
|
|
{{- if .Values.autoscaling.targetMemoryUtilizationPercentage }}
|
2020-06-29 21:58:48 +10:00
|
|
|
- type: Resource
|
|
|
|
resource:
|
|
|
|
name: memory
|
|
|
|
targetAverageUtilization: {{ .Values.autoscaling.targetMemoryUtilizationPercentage }}
|
2022-11-11 09:24:39 +11:00
|
|
|
{{- end }}
|
2020-06-29 21:58:48 +10:00
|
|
|
{{- end }}
|