Allow workers to be paused and scaled to zero when they are being man… - #177
Open
PedroMiguelFMoreira wants to merge 2 commits into
Open
Allow workers to be paused and scaled to zero when they are being man…#177PedroMiguelFMoreira wants to merge 2 commits into
PedroMiguelFMoreira wants to merge 2 commits into
Conversation
Contributor
There was a problem hiding this comment.
All reported issues were addressed across 4 files
Architecture diagram
sequenceDiagram
participant Admin as Administrator
participant Helm as Helm Chart
participant K8s as Kubernetes
participant KEDA as KEDA Operator
participant Worker as Worker Pods
Note over Admin,Worker: NEW: Worker Pause/Zero-Scale Flow
Admin->>Helm: Set keda.worker.pause=true
Helm->>K8s: Render ScaledObject template
alt pause=true
Helm->>K8s: NEW: Add annotations<br/>autoscaling.keda.sh/paused: "true"<br/>autoscaling.keda.sh/paused-replicas: "0"
else pause=false (default)
Helm->>K8s: Omit pause annotations<br/>(existing behavior)
end
K8s-->>KEDA: Watch ScaledObject
KEDA->>KEDA: Detect pause annotation
alt pause=true
KEDA->>Worker: Scale to 0 replicas
Worker-->>K8s: Terminate worker pods
KEDA->>KEDA: Pause autoscaling triggers
else pause=false
KEDA->>K8s: Monitor queue (existing)
K8s-->>KEDA: Queue depth
KEDA->>KEDA: Normal autoscaling logic
end
Note over KEDA,Worker: Unpause Flow
Admin->>Helm: Set keda.worker.pause=false
Helm->>K8s: Remove pause annotations
KEDA->>KEDA: Resume autoscaling
KEDA->>Worker: Scale to minReplicaCount
Reply with feedback, questions, or to request a fix.
Fix all with cubic | Re-trigger cubic
Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull Request
Description
Adds a
keda.worker.pausesetting to the n8n Helm chart so worker KEDA autoscaling can be paused and workers scaled to zero via ScaledObject annotations.Type of Change
Related Issues
Fixes # N/A
Relates to # N/A
Changes Made
keda.worker.pause(true/false, defaultfalse) to control KEDA worker autoscaling pause behaviorpauseistrue, the worker ScaledObject setsautoscaling.keda.sh/paused: "true"andautoscaling.keda.sh/paused-replicas: "0"to scale workers to zero and pause autoscalingTesting Performed
keda.worker.pauseenabled and disabledChart Validation
helm lint charts/n8npasses./scripts/validate-examples.shpassesDeployment Testing (if applicable)
Specific Testing for Changes
Describe any specific testing you performed for your changes:
keda.enabled=trueandkeda.worker.pause=falseto confirm pause annotations are omitted.keda.worker.pause=trueto confirm bothautoscaling.keda.sh/paused: "true"andautoscaling.keda.sh/paused-replicas: "0"are set on the worker ScaledObject.Breaking Changes
If this includes breaking changes, describe what they are and provide migration instructions:
false, so existing KEDA worker ScaledObjects continue to behave as before.Documentation Updates
Checklist
Screenshots (if applicable)
Not applicable.
Additional Notes
This change is backward compatible because
keda.worker.pausedefaults tofalseand only adds pause annotations when explicitly enabled.Summary by cubic
Adds
keda.worker.pauseto the Helm chart to pause KEDA worker autoscaling and scale workers to zero via ScaledObject annotations. This lets you temporarily stop workers without removing KEDA.keda.worker.pause(defaultfalse).true, addsautoscaling.keda.sh/paused: "true"andautoscaling.keda.sh/paused-replicas: "0"to the worker ScaledObject and merges withcommonAnnotations.keda-autoscaling.yamlexample.Written for commit 48132a2. Summary will update on new commits.