33 lines
1.1 KiB
YAML
33 lines
1.1 KiB
YAML
{{- if and .Values.frontend.enabled .Values.frontend.autoscaling.enabled }}
|
|
apiVersion: autoscaling/v2
|
|
kind: HorizontalPodAutoscaler
|
|
metadata:
|
|
name: {{ include "openrag.fullname" . }}-frontend
|
|
namespace: {{ include "openrag.namespace" . }}
|
|
labels:
|
|
{{- include "openrag.frontend.labels" . | nindent 4 }}
|
|
spec:
|
|
scaleTargetRef:
|
|
apiVersion: apps/v1
|
|
kind: Deployment
|
|
name: {{ include "openrag.fullname" . }}-frontend
|
|
minReplicas: {{ .Values.frontend.autoscaling.minReplicas }}
|
|
maxReplicas: {{ .Values.frontend.autoscaling.maxReplicas }}
|
|
metrics:
|
|
{{- if .Values.frontend.autoscaling.targetCPUUtilizationPercentage }}
|
|
- type: Resource
|
|
resource:
|
|
name: cpu
|
|
target:
|
|
type: Utilization
|
|
averageUtilization: {{ .Values.frontend.autoscaling.targetCPUUtilizationPercentage }}
|
|
{{- end }}
|
|
{{- if .Values.frontend.autoscaling.targetMemoryUtilizationPercentage }}
|
|
- type: Resource
|
|
resource:
|
|
name: memory
|
|
target:
|
|
type: Utilization
|
|
averageUtilization: {{ .Values.frontend.autoscaling.targetMemoryUtilizationPercentage }}
|
|
{{- end }}
|
|
{{- end }}
|