This repository has been archived on 2025-07-30. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.
django-helm-chart/templates/web/hpa.yaml
2022-12-23 10:21:07 -05:00

32 lines
947 B
YAML

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