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

[Release v0.14.0] change leadership mechanism #195

Conversation

RamLavi
Copy link
Member

@RamLavi RamLavi commented Jun 16, 2020

What this PR does / why we need it:
manual cherry pick of #182

Special notes for your reviewer:

Release note:

NONE

…elected leader pod

This also means we get can remove the use of leaderElectionChannel

Signed-off-by: Ram Lavi <ralavi@redhat.com>
…er()

Signed-off-by: Ram Lavi <ralavi@redhat.com>
in thie commit we move waitToStartLeading() to a separate go routine, so that both pods will start the controller-runtime manager.
we then add the leader election inside the controller runtime manager.

Signed-off-by: Ram Lavi <ralavi@redhat.com>
since the webhook service operates only on pods with kubemacpool leader label, we cant start the webhooks until the election is complete and a leader as been chosen.
in order to do that, we add a new status to the pod, to prevent the pods to be ready and the webhhoks to start until the label is set.

Signed-off-by: Ram Lavi <ralavi@redhat.com>
…appropriate rbacs.

Signed-off-by: Ram Lavi <ralavi@redhat.com>
Signed-off-by: Ram Lavi <ralavi@redhat.com>
…y will initiate after teh election is complete

since we don't want both pods to perform pool-manager related operations, we start the pool-manager routines  only after the kubemacpool leader is selected.

Signed-off-by: Ram Lavi <ralavi@redhat.com>
…oyment replicas, as well as making the needed changes in test to wait for both kubemacpool instead of only to the leader.

Signed-off-by: Ram Lavi <ralavi@redhat.com>
Signed-off-by: Ram Lavi <ralavi@redhat.com>
@qinqon
Copy link
Member

qinqon commented Jun 16, 2020

/lgtm
/approve

@kubevirt-bot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: qinqon

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@RamLavi RamLavi changed the title Release v0.14.0 change leadership mechanism [Release v0.14.0] change leadership mechanism Jun 16, 2020
@kubevirt-bot kubevirt-bot merged commit ad99bca into k8snetworkplumbingwg:release-v0.14.0 Jun 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants