Skip to content

[ws-manager-mk2] Configure leader election #16042

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

Merged
merged 1 commit into from
Feb 3, 2023

Conversation

WVerlaek
Copy link
Member

@WVerlaek WVerlaek commented Jan 26, 2023

Description

Configure leader election on the ws-manager-mk2 controller manager. Requires additional role policy rules to manage leases, these rules are taken from the generated leader_election_role.yaml by kubebuilder

Related Issue(s)

Relates to #11416

How to test

Open preview env, check logs of ws-manager-mk2 to confirm a leader-election lease has been successfully acquired

Release Notes

NONE

Documentation

Build Options:

  • /werft with-github-actions
    Experimental feature to run the build with GitHub Actions (and not in Werft).
  • leeway-no-cache
    leeway-target=components:all-ci
  • /werft no-test
    Run Leeway with --dont-test

Preview Environment Options:

  • /werft with-local-preview
    If enabled this will build install/preview
  • /werft with-preview
  • /werft with-large-vm
  • /werft with-gce-vm
    If enabled this will create the environment on GCE infra
  • /werft with-wsman-mk2
  • /werft with-integration-tests=all
    Valid options are all, workspace, webapp, ide, jetbrains, vscode, ssh

@WVerlaek WVerlaek self-assigned this Jan 26, 2023
@WVerlaek WVerlaek requested a review from a team January 26, 2023 10:49
@github-actions github-actions bot added the team: workspace Issue belongs to the Workspace team label Jan 26, 2023
@Furisto
Copy link
Member

Furisto commented Jan 30, 2023

/werft run with-preview

👍 started the job as gitpod-build-wv-ws-manager-mk2-leader-elect.1
(with .werft/ from main)

@Furisto
Copy link
Member

Furisto commented Jan 30, 2023

/werft run with-preview -with-wsman-mk2

👍 started the job as gitpod-build-wv-ws-manager-mk2-leader-elect.2
(with .werft/ from main)

@WVerlaek
Copy link
Member Author

WVerlaek commented Jan 30, 2023

/werft run with-preview with-wsman-mk2 with-large-vm

👍 started the job as gitpod-build-wv-ws-manager-mk2-leader-elect.3
(with .werft/ from main)

@werft-gitpod-dev-com
Copy link

started the job as gitpod-build-wv-ws-manager-mk2-leader-elect.4 because the annotations in the pull request description changed
(with .werft/ from main)

@WVerlaek WVerlaek force-pushed the wv/ws-manager-mk2-leader-elect branch from 4fc829b to 7eec01f Compare January 31, 2023 12:11
@WVerlaek
Copy link
Member Author

WVerlaek commented Jan 31, 2023

/werft run

👍 started the job as gitpod-build-wv-ws-manager-mk2-leader-elect.6
(with .werft/ from main)

@WVerlaek
Copy link
Member Author

WVerlaek commented Jan 31, 2023

/werft run

👍 started the job as gitpod-build-wv-ws-manager-mk2-leader-elect.7
(with .werft/ from main)

@WVerlaek WVerlaek force-pushed the wv/ws-manager-mk2-leader-elect branch from 7eec01f to f50e90e Compare February 1, 2023 10:48
@WVerlaek
Copy link
Member Author

WVerlaek commented Feb 2, 2023

/werft run recreate-vm

👍 started the job as gitpod-build-wv-ws-manager-mk2-leader-elect.9
(with .werft/ from main)

@kylos101
Copy link
Contributor

kylos101 commented Feb 2, 2023

/werft run with-integration-tests=workspace with-large-vm=true

👍 started the job as gitpod-build-wv-ws-manager-mk2-leader-elect.10
(with .werft/ from main)

@kylos101
Copy link
Contributor

kylos101 commented Feb 3, 2023

Ran following tests:

  1. Confirmed leader election starts and can finish
  2. Deleted single pod, election happens again flawlessly, sometimes the new pod is the leader
  3. Scaled up a second pod, the election starts, and never finishes, because there's a current leader
  4. Scaled up a second pod, cordoned the node, deleted the current leader, and leadership transitioned to the second pod, the third pod was pending because of cordoning

Nice! Works as designed!

Copy link
Contributor

@kylos101 kylos101 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✔️

@WVerlaek
Copy link
Member Author

WVerlaek commented Feb 3, 2023

/werft run

👍 started the job as gitpod-build-wv-ws-manager-mk2-leader-elect.11
(with .werft/ from main)

@roboquat roboquat merged commit 8601821 into main Feb 3, 2023
@roboquat roboquat deleted the wv/ws-manager-mk2-leader-elect branch February 3, 2023 14:02
@roboquat roboquat added deployed: workspace Workspace team change is running in production deployed Change is completely running in production labels Feb 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
deployed: workspace Workspace team change is running in production deployed Change is completely running in production release-note-none size/M team: workspace Issue belongs to the Workspace team
Projects
No open projects
Status: Done
Development

Successfully merging this pull request may close these issues.

4 participants