docs: correct anti-flapping example (#918)

* docs: correct anti-flapping example

* docs: provide complete example

* docs: use example/myrepo everywhere
This commit is contained in:
Callum Tait 2021-10-28 10:52:54 +01:00 committed by GitHub
parent 0416a9272f
commit 09e6b1839b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 24 additions and 6 deletions

View File

@ -251,7 +251,7 @@ kind: Runner
metadata:
name: example-runner
spec:
repository: actions-runner-controller/actions-runner-controller
repository: example/myrepo
env: []
```
@ -362,9 +362,11 @@ A `RunnerDeployment` or `RunnerSet` (see [stateful runners](#stateful-runners) f
#### Anti-Flapping Configuration
For both pull driven or webhook driven scaling an anti-flapping implementation is included, by default a runner won't be scaled down within 10 minutes of it having been scaled up. This delay is configurable by including the attribute `scaleDownDelaySecondsAfterScaleOut:` in a `RunnerDeployment` `spec:` (see snippet below).
For both pull driven or webhook driven scaling an anti-flapping implementation is included, by default a runner won't be scaled down within 10 minutes of it having been scaled up. This delay is configurable by including the attribute `scaleDownDelaySecondsAfterScaleOut:` in a `HorizontalRunnerAutoscaler` kind's `spec:`.
This configuration has the final say on if a runner can be scaled down or not regardless of the chosen scaling method. Depending on your requirements, you may want to consider adjusting this.
This configuration has the final say on if a runner can be scaled down or not regardless of the chosen scaling method. Depending on your requirements, you may want to consider adjusting this by setting the `scaleDownDelaySecondsAfterScaleOut:` attribute.
Below is a complete basic example with one of the pull driven scaling metrics.
```yaml
apiVersion: actions.summerwind.dev/v1alpha1
@ -372,11 +374,27 @@ kind: RunnerDeployment
metadata:
name: example-runner-deployment
spec:
# Runners in this RunnerDeployment won't be scaled down for 5 minutes instead of the default 10 minutes now
scaleDownDelaySecondsAfterScaleOut: 300
template:
spec:
repository: example/myrepo
---
apiVersion: actions.summerwind.dev/v1alpha1
kind: HorizontalRunnerAutoscaler
metadata:
name: example-runner-deployment-autoscaler
spec:
# Runners in the targeted RunnerDeployment won't be scaled down for 5 minutes instead of the default 10 minutes now
scaleDownDelaySecondsAfterScaleOut: 300
scaleTargetRef:
name: example-runner-deployment
minReplicas: 1
maxReplicas: 5
metrics:
- type: PercentageRunnersBusy
scaleUpThreshold: '0.75'
scaleDownThreshold: '0.25'
scaleUpFactor: '2'
scaleDownFactor: '0.5'
```
#### Pull Driven Scaling
@ -443,7 +461,7 @@ spec:
metrics:
- type: TotalNumberOfQueuedAndInProgressWorkflowRuns
repositoryNames:
- actions-runner-controller/actions-runner-controller
- example/myrepo
```
**PercentageRunnersBusy**