actions-runner-controller
actions-runner-controller copied to clipboard
Port ScheduledOverrides to AutoscalingRunnerSet
Fixes #3313 and #2986 (closed with no resolution)
Porting the great work by @mumoshu of the ScheduledOverrides
capability of HorizontalRunnerAutoscaler
to AutoscalingRunnerSet
How to use it
It's meant to be used in an almost identical way, with one exception - minReplicas
was renamed to minRunners
to conform with the current naming choice.
Examples:
- Within the
AutoscalingRunnerSet
CR directly:
apiVersion: actions.github.com/v1alpha1
kind: AutoscalingRunnerSet
metadata:
annotations: # abbreviated
labels: # abbreviated
name: example-gha-runner-scale-set
spec:
githubConfigSecret: "<some_value>"
githubConfigUrl: "<some_value>"
maxRunners: 2
minRunners: 1
scheduledOverrides:
- startTime: "2021-05-01T00:00:00+09:00"
endTime: "2021-05-03T00:00:00+09:00"
recurrenceRule:
frequency: Weekly
untilTime: "2024-07-01T00:00:00+09:00"
minRunners: 0
- With the
gha-runner-scale-set
helm chart, by settingscheduledOverrides
in the values:
minRunners: 1
maxRunners: 2
scheduledOverrides:
- startTime: "2021-05-01T00:00:00+09:00"
endTime: "2021-05-03T00:00:00+09:00"
recurrenceRule:
frequency: Weekly
untilTime: "2024-07-01T00:00:00+09:00"
minRunners: 0
Notable changes
Changes to the AutoscalingRunnerSet Status
-
Like the previous implementation of scheduled overrides, this PR introduces the
ScheduledOverridesSummary
field in theAutoscalingRunnerSet
Status. -
In order to share the desired minimum runners between the
AutoscalingRunnerSet
andAutoscalingListener
resources post scheduled overrides evaluation, an additional field is introduced to theAutoscalingRunnerSet
Status -DesiredMinRunners
. Whenever the listener's minRunners value is different thanDesiredMinRunners
, the listener is deleted so it can be recreated.
Changes to requeuing of requests
In order to reevaluate the scheduled overrides, the final return ctrl.Result{}, nil
in the autoscalingrunnerset reconciliation function was changed to requeue the request after 1 minute.