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