karmada-io / karmada

Open, Multi-Cloud, Multi-Cluster Kubernetes Orchestration
https://karmada.io
Apache License 2.0
4.12k stars 807 forks source link

Introduce a Lazy Activation feature to Policy #4563

Open chaosi-zju opened 3 months ago

chaosi-zju commented 3 months ago

What would you like to be added:

Introduced a ActivationPreference filed to Policy, indicating how the referencing resource template will be propagated, in case of policy changes.

If empty, the resource template will respond to policy changes immediately, in other words, any policy changes will drive the resource template to be propagated immediately as per the current propagation rules.

If the value is Lazy means the policy changes will not take effect for now but defer to the resource template changes, in other words, the resource template will not be propagated as per the current propagation rules until there is an update on it.

Why is this needed:

In the scenario where Policy responsibilities are separated from Resource responsibilities, one role is dedicated to Policy management, which is referred to as cluster administrator, and the other role is dedicated to Resource management, which is referred to as user. The cluster administrator would preconfigure some Policies for users, then the users apply their own Resources and propagated them according to the preconfigured Policy.

However, the administrator has requests to modify the Policy in the future, such as migrating propagation clusters. As the current Policy modification is effective immediately, the modification will affect the propagation status of a large number of resource templates and have a great impact on the system.

The administrator is worried that the modification will lead to the failure of the business application in the non-change window, so the administrator hopes that the modification of Policy can be delayed until the business application change window takes effect.

Notes

This feature has some system constraints and risks, which will be described in detail proposal document.


Related Actions

  1. Proposal
    • [x] #4602
  2. Implemention
    • [x] #4577
  3. Test
    • [ ] #4607
chaosi-zju commented 3 months ago

CC @RainbowMango

4564 and #4570 are all PRs about code modification, and ready to review, thanks.

XiShanYongYe-Chang commented 2 weeks ago

Can this issue be closed first? The E2E task can be tracked by #4607. @chaosi-zju