diff --git a/chart/templates/celery-auto-scaling.yaml b/chart/templates/celery-auto-scaling.yaml new file mode 100644 index 0000000000000000000000000000000000000000..dd06fe74ba239e8ee239abe4c256f7c0ae766900 --- /dev/null +++ b/chart/templates/celery-auto-scaling.yaml @@ -0,0 +1,39 @@ +{{- if .Values.celery.autoScaling}} +#apiVersion: autoscaling/v1 +#kind: HorizontalPodAutoscaler +#metadata: +# name: {{ printf "%s-%s" .Release.Name "hpa" }} +#spec: +# scaleTargetRef: +# apiVersion: apps/v1 +# kind: StatefulSet +# name: {{ printf "%s-%s" .Release.Name "celery" }} +# minReplicas: 1 +# maxReplicas: 3 +# targetCPUUtilizationPercentage: 50 +--- +apiVersion: autoscaling/v2beta2 +kind: HorizontalPodAutoscaler +metadata: + name: {{ printf "%s-%s" .Release.Name "hpa" }} +spec: + scaleTargetRef: + apiVersion: apps/v1 + kind: StatefulSet + name: {{ printf "%s-%s" .Release.Name "celery" }} + minReplicas: 1 + maxReplicas: 3 + metrics: + - type: Resource + resource: + name: cpu + target: + type: Utilization + averageUtilization: 50 + behavior: + scaleDown: + stabilizationWindowSeconds: 120 + scaleUp: + stabilizationWindowSeconds: 10 +--- +{{- end }} \ No newline at end of file diff --git a/chart/values.yaml b/chart/values.yaml index e9fce4ce888332602299253e61cc59322ee6ffde..7fcb111d8bef9b03dd208c55ce97802abadd4b27 100644 --- a/chart/values.yaml +++ b/chart/values.yaml @@ -50,7 +50,9 @@ ingress: name: chart-example.local celery: + # should not be enabled as long as project are not stored in a db autoScaling: false # optional, default: false + # should stay to 1 replicat as long as project are not stored in a db replicas: 1 # optional, default: 1 resources: requests: