diff --git a/helm/ezscale-website/templates/hpa-app.yaml b/helm/ezscale-website/templates/hpa-app.yaml new file mode 100644 index 0000000..b41b1e6 --- /dev/null +++ b/helm/ezscale-website/templates/hpa-app.yaml @@ -0,0 +1,23 @@ +{{- if .Values.app.autoscaling.enabled }} +apiVersion: autoscaling/v2 +kind: HorizontalPodAutoscaler +metadata: + name: {{ include "ezscale-website.fullname" . }}-app + labels: + {{- include "ezscale-website.labels" . | nindent 4 }} + app.kubernetes.io/component: app +spec: + scaleTargetRef: + apiVersion: apps/v1 + kind: Deployment + name: {{ include "ezscale-website.fullname" . }}-app + minReplicas: {{ .Values.app.autoscaling.minReplicas }} + maxReplicas: {{ .Values.app.autoscaling.maxReplicas }} + metrics: + - type: Resource + resource: + name: cpu + target: + type: Utilization + averageUtilization: {{ .Values.app.autoscaling.targetCPU }} +{{- end }}