Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: autoscale previews to 0 #4430

Draft
wants to merge 7 commits into
base: master
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions helm-chart/templates/autoscale.yml
Original file line number Diff line number Diff line change
@@ -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