56 lines
1.9 KiB
YAML
56 lines
1.9 KiB
YAML
{{- if .Values.apiAutoscaling.enabled }}
|
|
apiVersion: keda.sh/v1alpha1
|
|
kind: ScaledObject
|
|
metadata:
|
|
labels: &labels
|
|
{{ include "deepgram-self-hosted.labels" . | indent 4}}
|
|
namespace: {{ .Values.apiAutoscaling.namespace }}
|
|
name: deepgram-api-hpa
|
|
spec:
|
|
scaleTargetRef:
|
|
apiVersion: apps/v1
|
|
kind: Deployment
|
|
name: {{ .Values.apiAutoscaling.targetName }}
|
|
pollingInterval: {{ .Values.apiAutoscaling.pollingInterval }}
|
|
{{- if ( default false (.Values.disasterRecovery).enabled ) }}
|
|
minReplicaCount: 1
|
|
{{- else }}
|
|
minReplicaCount: {{ .Values.apiAutoscaling.minReplicas }}
|
|
{{- end }}
|
|
maxReplicaCount: {{ .Values.apiAutoscaling.maxReplicas }}
|
|
advanced:
|
|
horizontalPodAutoscalerConfig:
|
|
behavior:
|
|
scaleDown:
|
|
stabilizationWindowSeconds: {{ .Values.apiAutoscaling.scaledown.stabilizationWindowSeconds }}
|
|
policies:
|
|
{{- range .Values.apiAutoscaling.scaledown.policies }}
|
|
- type: {{ .type }}
|
|
value: {{ .value }}
|
|
periodSeconds: {{ .periodseconds }}
|
|
{{- end }}
|
|
selectPolicy: {{ .Values.apiAutoscaling.scaledown.selectpolicy }}
|
|
scaleUp:
|
|
stabilizationWindowSeconds: {{ .Values.apiAutoscaling.scaleup.stabilizationWindowSeconds }}
|
|
policies:
|
|
{{- range .Values.apiAutoscaling.scaleup.policies }}
|
|
- type: {{ .type }}
|
|
value: {{ .value }}
|
|
periodSeconds: {{ .periodseconds }}
|
|
{{- end }}
|
|
selectPolicy: {{ .Values.apiAutoscaling.scaleup.selectpolicy }}
|
|
triggers:
|
|
{{- if ( default false (.Values.disasterRecovery).enabled ) }}
|
|
{{- range $.Values.apiAutoscaling.triggers }}
|
|
{{- if or (eq .type "cpu") (eq .type "memory") }}
|
|
- metadata:
|
|
{{- toYaml .metadata | nindent 8 }}
|
|
type: {{ .type }}
|
|
metricType: "Utilization"
|
|
{{- end }}
|
|
{{- end }}
|
|
{{- else }}
|
|
{{- toYaml .Values.apiAutoscaling.triggers | nindent 2 }}
|
|
{{ end }}
|
|
{{- end }}
|