32 lines
1.1 KiB
YAML
32 lines
1.1 KiB
YAML
{{- if .Values.scaling.auto.enabled -}}
|
|
apiVersion: autoscaling/v2
|
|
kind: HorizontalPodAutoscaler
|
|
metadata:
|
|
name: {{ .Values.api.namePrefix }}-hpa
|
|
labels: &labels
|
|
{{ include "deepgram-self-hosted.labels" . | indent 4}}
|
|
{{- range $key, $val := .Values.api.additionalLabels }}
|
|
{{ $key }}: {{ $val | quote }}
|
|
{{- end}}
|
|
spec:
|
|
scaleTargetRef:
|
|
apiVersion: apps/v1
|
|
kind: Deployment
|
|
name: {{ .Values.api.namePrefix }}
|
|
minReplicas: {{ (divf .Values.scaling.auto.engine.minReplicas .Values.scaling.auto.api.metrics.engineToApiRatio) | ceil | int64 }}
|
|
maxReplicas: {{ (divf .Values.scaling.auto.engine.maxReplicas .Values.scaling.auto.api.metrics.engineToApiRatio) | ceil | int64 }}
|
|
metrics:
|
|
- type: External
|
|
external:
|
|
metric:
|
|
name: engine_to_api_pod_ratio
|
|
target:
|
|
type: Value
|
|
value: {{ .Values.scaling.auto.api.metrics.engineToApiRatio }}
|
|
{{- if .Values.scaling.auto.api.metrics.custom }}
|
|
{{- toYaml .Values.scaling.auto.api.metrics.custom | nindent 4 }}
|
|
{{- end }}
|
|
behavior:
|
|
{{- toYaml .Values.scaling.auto.api.behavior | nindent 4 }}
|
|
{{- end -}}
|