mirror of
https://github.com/HangarMC/Hangar.git
synced 2024-12-15 06:41:46 +08:00
29 lines
985 B
YAML
29 lines
985 B
YAML
{{- if .Values.backend.autoscaling.enabled }}
|
|
apiVersion: autoscaling/v2beta1
|
|
kind: HorizontalPodAutoscaler
|
|
metadata:
|
|
name: {{ include "hangar.fullname" . }}-backend
|
|
labels:
|
|
{{- include "hangar.labels" . | nindent 4 }}
|
|
spec:
|
|
scaleTargetRef:
|
|
apiVersion: apps/v1
|
|
kind: Deployment
|
|
name: {{ include "hangar.fullname" . }}-backend
|
|
minReplicas: {{ .Values.backend.autoscaling.minReplicas }}
|
|
maxReplicas: {{ .Values.backend.autoscaling.maxReplicas }}
|
|
metrics:
|
|
{{- if .Values.backend.autoscaling.targetCPUUtilizationPercentage }}
|
|
- type: Resource
|
|
resource:
|
|
name: cpu
|
|
targetAverageUtilization: {{ .Values.backend.autoscaling.targetCPUUtilizationPercentage }}
|
|
{{- end }}
|
|
{{- if .Values.backend.autoscaling.targetMemoryUtilizationPercentage }}
|
|
- type: Resource
|
|
resource:
|
|
name: memory
|
|
targetAverageUtilization: {{ .Values.backend.autoscaling.targetMemoryUtilizationPercentage }}
|
|
{{- end }}
|
|
{{- end }}
|