openyurt icon indicating copy to clipboard operation
openyurt copied to clipboard

[feature request] `NodePool Governance Capability`: Yurthub adds lease proxy mechanism

Open Peeknut opened this issue 2 years ago • 3 comments

What would you like to be added: Yurthub needs to add a leader election mechanism and a lease proxy mechanism.

Leader election mechanism can be described as:

  • Yurthub senses the existence of pool-coordinator and participates in leader election if it can connect to the cloud.
  • Leader Yurthub should list/watch the lease resources in the pool-coordinator.

Lease proxy mechanism can be described as:

  • When Yurthub starts, it applies to the cloud for a client certificate for lease forwarding.
  • If the node can connect to the cloud, then send the lease to the cloud.
  • If the node is disconnected from the cloud, add delegate annotation to the lease and send the lease to pool-coordinator.
  • After leader Yurthub watches the lease, it creates the node lease (with delegate annotation) and forwards it to the cloud. If the lease of pool-coordinator node is also need to be forwarded, the leader YurtHub will give priority to forwarding Node leases of its node.

Notes: For details, please refer to the proposal: https://github.com/openyurtio/openyurt/pull/772

Why is this needed: As mentioned in the proposal(https://github.com/openyurtio/openyurt/pull/772), in the node pool governance, the yurthub connected to the cloud will elect a leader, and the leader will forward the heartbeat of the node disconnected from the cloud to the cloud, so that the cloud can distinguish whether the disconnection of the node is caused by a node failure or a network disconnection. Therefore, yurthub needs to add a leader election mechanism and a heartbeat information reporting mechanism. others /kind feature

Peeknut avatar Mar 10 '22 07:03 Peeknut

/assign @rambohe-ch

rambohe-ch avatar Mar 24 '22 02:03 rambohe-ch

Progress update:

  1. pool-coordinator existence checker: in progress
  2. leader election for yurthub: almost finished
  3. a new client certificate for pool-coordinator in yurthub: in progress
  4. lease forwarding: todo

rambohe-ch avatar May 25 '22 02:05 rambohe-ch

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Sep 12 '22 03:09 stale[bot]

State machine for leader election of Yurthub: image

rambohe-ch avatar Oct 28 '22 02:10 rambohe-ch

workflow for leader election of Yurthub: image

rambohe-ch avatar Oct 28 '22 02:10 rambohe-ch

workflow for Yurthub coordinator: image

rambohe-ch avatar Oct 28 '22 02:10 rambohe-ch

/close

rambohe-ch avatar Jan 19 '23 08:01 rambohe-ch

@rambohe-ch: Closing this issue.

In response to this:

/close

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

openyurt-bot avatar Jan 19 '23 08:01 openyurt-bot