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

Introduce a new annotation propagationpolicy.karmada.io/generation #5156

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

chaunceyjiang
Copy link
Member

What type of PR is this?
/kind feature

What this PR does / why we need it:

Previously, a new feature was introduced for PP via #4602. Simply put, when the PP is changed, it will not take effect immediately. It only takes effect when the resource template selected by the PP changes.

However, this has raised a new issue in our product. Users cannot quickly determine whether the current resource template has applied the latest PP.

Therefore, I am introducing a new annotation here that stores the generation of an already effective PP. This way users can quickly confirm whether they have applied the latest PP by comparing if their generation is equal.

Which issue(s) this PR fixes:

When PropagationPolicy is in Lazy mode, introduce a new annotation propagationpolicy.karmada.io/generation and clusterpropagationpolicy.karmada.io/generation.

Special notes for your reviewer:

Does this PR introduce a user-facing change?:

Introduce a new annotation propagationpolicy.karmada.io/generation

@karmada-bot karmada-bot added the kind/feature Categorizes issue or PR as related to a new feature. label Jul 8, 2024
@karmada-bot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign rainbowmango for approval. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found 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

@karmada-bot karmada-bot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Jul 8, 2024
@chaunceyjiang
Copy link
Member Author

/cc @chaosi-zju PTAL.

@codecov-commenter
Copy link

codecov-commenter commented Jul 8, 2024

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

Attention: Patch coverage is 0% with 33 lines in your changes missing coverage. Please review.

Project coverage is 28.22%. Comparing base (f869fba) to head (3e53285).
Report is 18 commits behind head on master.

Files Patch % Lines
pkg/detector/detector.go 0.00% 30 Missing ⚠️
pkg/detector/preemption.go 0.00% 3 Missing ⚠️

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #5156      +/-   ##
==========================================
+ Coverage   28.21%   28.22%   +0.01%     
==========================================
  Files         632      632              
  Lines       43553    43590      +37     
==========================================
+ Hits        12289    12305      +16     
- Misses      30367    30388      +21     
  Partials      897      897              
Flag Coverage Δ
unittests 28.22% <0.00%> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@chaosi-zju
Copy link
Member

/assign

Thanks, this is a nice improvement!

I'll take a closer look tomorrow.

pkg/detector/detector.go Outdated Show resolved Hide resolved
pkg/detector/detector.go Outdated Show resolved Hide resolved
@chaosi-zju
Copy link
Member

Do you think it is necessary to add generation annotations to ResourceBinding to improve observability?

@chaunceyjiang
Copy link
Member Author

Do you think it is necessary to add generation annotations to ResourceBinding to improve observability?

I'm not sure, we don't have that requirement at the moment.

pkg/detector/detector.go Outdated Show resolved Hide resolved
@karmada-bot karmada-bot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Jul 9, 2024
@chaunceyjiang chaunceyjiang force-pushed the generation branch 3 times, most recently from 6e0476c to 4a1c91f Compare July 9, 2024 11:25
@chaosi-zju
Copy link
Member

chaosi-zju commented Jul 9, 2024

It seems fine, but I suggest bringing this generation annotation regardless of whether lazy or not, but not refreshing the generation when resourceChangeByKarmada && util.IsLazyActivationEnabled(policy.Spec.ActivationPreference), because the current code is too complex and difficult to understand.

CC @RainbowMango

Signed-off-by: chaunceyjiang <chaunceyjiang@gmail.com>
@RainbowMango
Copy link
Member

However, this has raised a new issue in our product. Users cannot quickly determine whether the current resource template has applied the latest PP.

A question is whether your product uses the Lazy feature? If I remember correctly, you would not make use it at all.

It seems a general requirement that users want to know whether their workload is correctly handled by specific PropagationPolicy, now we have the permanent ID on the resource template, but we still lack more accurate info to figure out if subsequent changes are applied or not.

@chaunceyjiang
Copy link
Member Author

A question is whether your product uses the Lazy feature? If I remember correctly, you would not make use it at all.

Yes, our product has not yet adopted it. The plan is to introduce some features of Karmada into our product this month. We have conducted research on this special effect and after internal discussions, we found the problem I described in the issue.

Before introducing this special effect, we always assumed that PP takes effect immediately, so our product can find the effective PP through the PP name and PP namespace on the resource template.

@RainbowMango
Copy link
Member

Yes, our product has not yet adopted it. The plan is to introduce some features of Karmada into our product this month.

If you do mean the Lazy feature, please give it another thought except you have a split use case and verified thoroughly.
Because this feature lacks enough feedback and has some kind of relationship with #5118, particularly when thinking of introducing pause to PP.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature Categorizes issue or PR as related to a new feature. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants