django-helm-chart/templates/worker/hpa.yaml
2022-12-23 10:21:07 -05:00

32 lines
973 B
YAML

{{- if .Values.worker.autoscaling.enabled -}}
apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
name: {{ template "django.fullname" . }}-worker
labels:
{{- include "django.labels" . | nindent 4 }}
spec:
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: {{ template "django.fullname" . }}-worker
minReplicas: {{ .Values.worker.autoscaling.minReplicas }}
maxReplicas: {{ .Values.worker.autoscaling.maxReplicas }}
metrics:
{{- if .Values.worker.autoscaling.targetCPU }}
- type: Resource
resource:
name: cpu
target:
type: "Utilization"
averageUtilization: {{ .Values.worker.autoscaling.targetCPU }}
{{- end }}
{{- if .Values.worker.autoscaling.targetMemory }}
- type: Resource
resource:
name: memory
target:
type: "Utilization"
averageUtilization: {{ .Values.worker.autoscaling.targetMemory }}
{{- end }}
{{- end }}