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

Experimental support for ScheduledOverrides #515

Merged
merged 1 commit into from
May 3, 2021

Conversation

mumoshu
Copy link
Collaborator

@mumoshu mumoshu commented May 3, 2021

This adds the initial version of ScheduledOverrides to HorizontalRunnerAutoscaler.

Daily/Weekly/Monthly/Yearly MinReplicas overriding should just work.

Here's an example of a weekly override:

apiVersion: actions.summerwind.dev/v1alpha1
kind: HorizontalRunnerAutoscaler
metadata:
  name: example-runner-deployment-autoscaler
spec:
  scaleTargetRef:
    name: example-runner-deployment
  scheduledOverrides:
  # Override minReplicas to 0 only between 0am sat to 0am mon
  # Note that I've explicitly used the term `range` because this isn't how you usually use crontab expression...
  - startTime: "2021-05-01T00:00:00+09:00"
    endTime: "2021-05-03T00:00:00+09:00"
    recurrenceRule:
      frequency: Weekly
      untilTime: "2022-05-01T00:00:00+09:00"
    minReplicas: 0
  minReplicas: 1

When there are two or more ScheduledOverrides, the earliest one that matched is activated.

Each ScheduledOverride can be recurring or one-time. If you have two or more ScheduledOverrides, only one of them should be one-time. And the one-time override should be the earliest item in the list to make sense.

Ref #484

Notes:

This fixes API/CRD changes made in the wrong place in #514.

Tests will be added in another commit. Logging improvements and additional observability in HRA.Status will also be added in yet another commit.

This adds the initial version of ScheduledOverrides to HorizontalRunnerAutoscaler.
`MinReplicas` overriding should just work.
When there are two or more ScheduledOverrides, the earliest one that matched is activated. Each ScheduledOverride can be recurring or one-time. If you have two or more ScheduledOverrides, only one of them should be one-time. And the one-time override should be the earliest item in the list to make sense.

Tests will be added in another commit. Logging improvements and additional observability in HRA.Status will also be added in yet another commits.

Ref #484
@mumoshu mumoshu merged commit 0e0f385 into master May 3, 2021
@mumoshu mumoshu deleted the experimenta-scheduled-overrides branch May 3, 2021 14:31
mumoshu added a commit that referenced this pull request May 11, 2021
Also adds more debug logs for observability.

Follow-up for #515
Ref #484
mumoshu added a commit that referenced this pull request May 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant