diff --git a/charts/flagsmith/templates/hpa-sse.yaml b/charts/flagsmith/templates/hpa-sse.yaml new file mode 100644 index 0000000..1279ee2 --- /dev/null +++ b/charts/flagsmith/templates/hpa-sse.yaml @@ -0,0 +1,20 @@ +{{- if .Values.hpa.sse.enabled }} +apiVersion: autoscaling/v2 +kind: HorizontalPodAutoscaler +metadata: + name: {{ template "flagsmith.fullname" . }}-sse-hpa +spec: + scaleTargetRef: + apiVersion: apps/v1 + kind: Deployment + name: {{ template "flagsmith.fullname" . }}-sse + minReplicas: {{ .Values.hpa.sse.minReplicas }} + maxReplicas: {{ .Values.hpa.sse.maxReplicas }} + metrics: + - type: Resource + resource: + name: cpu + target: + type: Utilization + averageUtilization: {{ .Values.hpa.sse.targetCPUUtilization }} +{{- end }} diff --git a/charts/flagsmith/templates/hpa-task-processor.yaml b/charts/flagsmith/templates/hpa-task-processor.yaml new file mode 100644 index 0000000..f2d8315 --- /dev/null +++ b/charts/flagsmith/templates/hpa-task-processor.yaml @@ -0,0 +1,20 @@ +{{- if .Values.hpa.taskProcessor.enabled }} +apiVersion: autoscaling/v2 +kind: HorizontalPodAutoscaler +metadata: + name: {{ template "flagsmith.fullname" . }}-task-processor-hpa +spec: + scaleTargetRef: + apiVersion: apps/v1 + kind: Deployment + name: {{ template "flagsmith.fullname" . }}-task-processor + minReplicas: {{ .Values.hpa.taskProcessor.minReplicas }} + maxReplicas: {{ .Values.hpa.taskProcessor.maxReplicas }} + metrics: + - type: Resource + resource: + name: cpu + target: + type: Utilization + averageUtilization: {{ .Values.hpa.taskProcessor.targetCPUUtilization }} +{{- end }} diff --git a/charts/flagsmith/values.yaml b/charts/flagsmith/values.yaml index c068dfb..8edf431 100644 --- a/charts/flagsmith/values.yaml +++ b/charts/flagsmith/values.yaml @@ -448,6 +448,16 @@ hpa: minReplicas: 2 maxReplicas: 10 targetCPUUtilization: 50 + taskProcessor: + enabled: false + minReplicas: 2 + maxReplicas: 10 + targetCPUUtilization: 50 + sse: + enabled: true + minReplicas: 1 + maxReplicas: 5 + targetCPUUtilization: 50 ingress: frontend: