fleet icon indicating copy to clipboard operation
fleet copied to clipboard

Scheduled rollout

Open Athosone opened this issue 3 years ago • 10 comments

Feature description

This feature allows you to plan a deployment at a given period.

A period is composed of a cron and a duration.

Both of these properties represents a window during which the application can be deployed.

The schedule can be applied to either the cluster itself and/or the bundle.

If schedules are set on both the cluster and the bundle then the bundle schedule takes priority over the cluster schedule.

We chose to prioritise the bundle over the cluster as we think that the user may want to specify exceptions to the global rule of a cluster schedule.

Usage Example

fleet.yaml

defaultNamespace: default
namespace: default

schedule:
  cron: "0 16 * * *"
  duration: "1h"

cluster

apiVersion: fleet.cattle.io/v1alpha1
kind: Cluster
metadata:
  name: c-kd88w
  namespace: fleet-default
spec:
  paused: false
  deploymentSchedule:
    cron: "0 16 * * *"
    duration: "1h"

Motivation for this PR

We noticed there was an existing PR rancher/fleet#450 for this feature related to rancher/fleet#383, but saw that there was no activity on it.

Also there were two implementation details that were not right in our opinion:

  • If the agent was triggered during the schedule window, it would be skipped and be scheduled for the next. If your window was large (days, weeks, months), it would take a while for it to be installed.
  • If the bundle has already been scheduled (https://github.com/rancher/fleet/pull/450/files#diff-8b83e3ec81ef037af3e68026d07535637ca1d84af565be9bcda91135c4b80714R111), the nextRun was evaluated using the ScheduledAt and not computed using the cron and duration. This would result in the bundle being scheduled for the nextRun even if the cron and duration did not match the ScheduledAt anymore.

Athosone avatar Mar 08 '22 19:03 Athosone

@ibrokethecloud @nickgerace FYI, tagging you because you were involved in the previous PR.

gravufo avatar Mar 08 '22 19:03 gravufo

I've raised this with the Fleet team, they're aware and will start working through community PRs soon.

richard-cox avatar Mar 22 '22 08:03 richard-cox

Tagging @ibrokethecloud - will you please review this as it brings up a two instances not covered in yours and advise whether yours should be closed in favor of this one?

SheilaghM avatar Mar 23 '22 21:03 SheilaghM

@SheilaghM Any news? We are now in May and we still have no feedback after 2 months.

gravufo avatar May 06 '22 14:05 gravufo

Hi @Athosone thanks a lot for your PR. There are few minor tweaks needed which should make the agent more efficient in scheduling the changes.

@SheilaghM can we please have some clarity on whether cluster scoped schedule supersedes the bundle scoped one or are we happy to have the bundle schedule have priority.

ibrokethecloud avatar May 09 '22 04:05 ibrokethecloud

Hi :)!

Sure no problem let me know I'll fix it !

Athosone avatar May 09 '22 13:05 Athosone

Hey :)!

Did you have the time to think about this PR?

@ibrokethecloud @SheilaghM

Athosone avatar May 16 '22 13:05 Athosone

@Athosone - We are still discussing the Fleet use cases with Product Management. We will act on this one way or another as soon as we have clarity.

SheilaghM avatar May 25 '22 15:05 SheilaghM

Any news on this?

CiraciNicolo avatar May 02 '24 11:05 CiraciNicolo

We could rebase it and try to push it again if the fleet team is still interested in the contrib

Athosone avatar May 02 '24 18:05 Athosone