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

Multiple enhancements - leader election, events, time window, delay after upgrading #335

Merged
merged 4 commits into from
Nov 4, 2024

Conversation

brandond
Copy link
Member

@brandond brandond commented Oct 31, 2024

Add some long-requested or at least long overdue features:

New fields:

  • spec.window: TimeWindow from github.com/kubereboot/kured/pkg/timewindow.
    Plan will not start creating Jobs for Nodes outside this time window. If there are already Nodes in progress (status.applying is not empty) when the window closes, the Plan will continue to run until finished.
spec:
  window:
    days:
      - "saturday"
      - "sunday"
    startTime: "8:00"
    endTime: "16:00"
    timeZone: "UTC"
  • spec.postCompleteDelay: positive time.Duration string.
    By default, Nodes are marked as done as soon as the Job is complete. When this is set, the Job must be Completed for at least this long before the Node is marked as done via Plan hash label. Job TTLSecondsAfterFinished is set to at least 1 minute longer than this delay, to ensure that the controller gets a chance to see the Job complete.
spec:
  postCompleteDelay: "1m30s"

Example of events:

brandond@dev01:~$ kubectl events -n system-upgrade --for plan/server-plan
LAST SEEN               TYPE     REASON               OBJECT             MESSAGE
7m33s                   Normal   Validated            Plan/server-plan   Plan is valid
7m33s                   Normal   Resolved             Plan/server-plan   Resolved latest version from Spec.Channel: v1.30.6-k3s1
7m32s (x2 over 7m33s)   Normal   Waiting              Plan/server-plan   Waiting for start of Spec.Window to sync Jobs for version v1.30.6-k3s1. Hash: 848b017d8bfbda18dddf2c0405a16c8658da7da2e867e167506e99b1
5m32s                   Normal   SyncJob              Plan/server-plan   Jobs synced for version v1.30.6-k3s1 on Nodes k3s-server-2. Hash: 848b017d8bfbda18dddf2c0405a16c8658da7da2e867e167506e99b1
4m59s                   Normal   JobCompleteWaiting   Plan/server-plan   Job completed on Node k3s-server-2, waiting 1m30s PostCompleteDelay
3m29s                   Normal   JobComplete          Plan/server-plan   Job completed on Node k3s-server-2
3m29s                   Normal   SyncJob              Plan/server-plan   Jobs synced for version v1.30.6-k3s1 on Nodes k3s-server-1. Hash: 848b017d8bfbda18dddf2c0405a16c8658da7da2e867e167506e99b1
2m55s                   Normal   JobCompleteWaiting   Plan/server-plan   Job completed on Node k3s-server-1, waiting 1m30s PostCompleteDelay
85s                     Normal   JobComplete          Plan/server-plan   Job completed on Node k3s-server-1
85s                     Normal   Complete             Plan/server-plan   Jobs complete for version v1.30.6-k3s1. Hash: 848b017d8bfbda18dddf2c0405a16c8658da7da2e867e167506e99b1

brandond@dev01:~$ kubectl events
LAST SEEN   TYPE     REASON    OBJECT             MESSAGE
20m         Normal   Starting  Node/k3s-server-2  system-upgrade-controller 08d5fdf (08d5fdf) starting leader election for system-upgrade/system-upgrade-controller
20m         Normal   Started   Node/k3s-server-2  system-upgrade-controller 08d5fdf (08d5fdf) running as system-upgrade/system-upgrade-controller

@brandond brandond force-pushed the misc-enhancements branch 5 times, most recently from e3a924e to 91815cb Compare November 1, 2024 21:55
@brandond brandond marked this pull request as ready for review November 1, 2024 23:57
@brandond brandond changed the title [WIP] Misc enhancements Multiple enhancements - leader election, events, windows, delay after upgrading Nov 2, 2024
Signed-off-by: Brad Davidson <[email protected]>
@brandond brandond merged commit 67bbce8 into rancher:master Nov 4, 2024
3 checks passed
@brandond brandond changed the title Multiple enhancements - leader election, events, windows, delay after upgrading Multiple enhancements - leader election, events, time windows, delay after upgrading Dec 9, 2024
@brandond brandond changed the title Multiple enhancements - leader election, events, time windows, delay after upgrading Multiple enhancements - leader election, events, time window, delay after upgrading Dec 9, 2024
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.

2 participants