fleet
fleet copied to clipboard
Scheduled rollout
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
nextRunwas evaluated using theScheduledAtand not computed using thecronandduration. This would result in the bundle being scheduled for thenextRuneven if thecronanddurationdid not match theScheduledAtanymore.
@ibrokethecloud @nickgerace FYI, tagging you because you were involved in the previous PR.
I've raised this with the Fleet team, they're aware and will start working through community PRs soon.
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 Any news? We are now in May and we still have no feedback after 2 months.
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.
Hi :)!
Sure no problem let me know I'll fix it !
Hey :)!
Did you have the time to think about this PR?
@ibrokethecloud @SheilaghM
@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.
Any news on this?
We could rebase it and try to push it again if the fleet team is still interested in the contrib