longhorn / longhorn

Cloud-Native distributed storage built on and for Kubernetes
https://longhorn.io
Apache License 2.0
6.01k stars 592 forks source link

[REFACTORING] Refactoring the Logic for Resources Monitoring #2441

Open PhanLe1010 opened 3 years ago

PhanLe1010 commented 3 years ago

We should consider refactoring the logic for engine and instance manager monitoring logic according to this suggestion https://github.com/longhorn/longhorn-manager/pull/854#issuecomment-812101940

The idea is that the monitor is keeping state of the CR and ensuring a requeue of the CR when there is new update. The main sync function will be the one who makes the RS get/update calls to the DS.

DoD

Refactor the controllers:

jenting commented 2 years ago

The backup controller is done with this PR.

innobead commented 2 years ago

https://github.com/longhorn/longhorn-manager/pull/1292#issuecomment-1095209547

innobead commented 2 years ago

The new resource monitoring has been introduced at https://github.com/longhorn/longhorn-manager/commit/5788939bf8c558fecaf906c81407dbd048d502dc when the orphan controller gets introduced in 1.3.0. So all the refactoring will be based on this.

cc @derekbit @shuo-wu