openyurt
openyurt copied to clipboard
[feature request] `NodePool Governance Capability`: Yurthub adds lease proxy mechanism
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
/assign @rambohe-ch
Progress update:
- pool-coordinator existence checker: in progress
- leader election for yurthub: almost finished
- a new client certificate for pool-coordinator in yurthub: in progress
- lease forwarding: todo
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.
State machine for leader election of Yurthub:
workflow for leader election of Yurthub:
workflow for Yurthub coordinator:
/close
@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.