diff --git a/helm-chart/templates/autoscale.yml b/helm-chart/templates/autoscale.yml new file mode 100644 index 0000000000..4981203def --- /dev/null +++ b/helm-chart/templates/autoscale.yml @@ -0,0 +1,19 @@ +apiVersion: keda.sh/v1alpha1 +kind: ScaledObject +metadata: + name: {{ include "emx2.fullname" . }}-scaler + namespace: default # Replace with your namespace if different +spec: + scaleTargetRef: + name: {{ include "emx2.fullname" .}} + minReplicaCount: 0 # when sleeping we don't have the preview + maxReplicaCount: 1 # maximum one preview server + pollingInterval: 10 # check every 10 secs if we need to scale up the preview + cooldownPeriod: 5 # very short now so we can check + triggers: + - type: http + metadata: + endpoint: / # we use the root to trigger awakening the preview + method: GET + threshold: "1" # Scale up when at least one request is detected + targetValue: "1" # Target value for scaling up