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