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

fix: prune deployment revision annotation #4946

Merged
merged 1 commit into from
May 21, 2024

Conversation

a7i
Copy link
Contributor

@a7i a7i commented May 16, 2024

What type of PR is this?

/kind bug

What this PR does / why we need it:

We noticed that karmada and member cluster controller-manager are fighting against each other where we get over 6k updates for a single deployment per hour.

the culprit seems to be the revision annotation.

Screenshot 2024-05-15 at 8 49 36 PM

Which issue(s) this PR fixes:
Fixes #

Special notes for your reviewer:

while generally the karmdaa setup doesn't run the Deployment controller on the karmada-apiserver, it does support promoting resources which can lead to having these annotations cause a diff with the member cluster(s).

Does this PR introduce a user-facing change?:

fix: prune deployment revision annotations

@karmada-bot karmada-bot added the kind/bug Categorizes issue or PR as related to a bug. label May 16, 2024
@karmada-bot karmada-bot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label May 16, 2024
@codecov-commenter
Copy link

codecov-commenter commented May 16, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 53.31%. Comparing base (3314771) to head (3dfa5b5).

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

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #4946      +/-   ##
==========================================
- Coverage   53.32%   53.31%   -0.01%     
==========================================
  Files         252      252              
  Lines       20485    20489       +4     
==========================================
+ Hits        10923    10924       +1     
- Misses       8841     8844       +3     
  Partials      721      721              
Flag Coverage Δ
unittests 53.31% <100.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.

@XiShanYongYe-Chang
Copy link
Member

Hi @a7i I think that the requirement proposed by #4945 can solve the issue raised by the current PR.

@RainbowMango
Copy link
Member

while generally the karmdaa setup doesn't run the Deployment controller on the karmada-apiserver, it does support promoting resources which can lead to having these annotations cause a diff with the member cluster(s).

Do you mean you promoted a Deployment resource from the member cluster, which has the annotation deployment.kubernetes.io/revision and deployment.kubernetes.io/revision-history, the conflict comes when Karmada tries to update them back?

@RainbowMango
Copy link
Member

Hi @a7i I think that the requirement proposed by #4945 can solve the issue raised by the current PR.

Yes, but before that, what's your opinion on this PR?
It makes sense to me to remove those annotations from Deployment as it is the Kubernetes native resources.

@XiShanYongYe-Chang
Copy link
Member

Previous view: Can we put the conflicts caused by controllers that are not enabled into the new hook point?

Previous view: It makes sense to me to remove those annotations from Deployment as it is the Kubernetes native resources.

Based on this, new view: For Kubernetes native resources, we can put it into the default behavior.

@a7i
Copy link
Contributor Author

a7i commented May 16, 2024

the conflict comes when Karmada tries to update them back?

That's correct!

I think that the requirement proposed by #4945 can solve the issue raised by the current PR.

Retain or Prune will work here. With Retain, we'll just get an extra Update after first creation but ignored after that.

Given it's kubernetes native annotation, I think it makes sense to make it a default behavior but will defer to you all.

@RainbowMango
Copy link
Member

Given it's kubernetes native annotation, I think it makes sense to make it a default behavior but will defer to you all.

+1
LGTM
But seems you might need to rebase and resolve the conflicts.

@RainbowMango
Copy link
Member

@a7i Can you help to rebase this PR and resolve the conflicts?

@a7i a7i force-pushed the remove-deploy-revision branch from 1a86e32 to 3dfa5b5 Compare May 20, 2024 11:19
Copy link
Member

@RainbowMango RainbowMango left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm
/approve

@karmada-bot karmada-bot added the lgtm Indicates that a PR is ready to be merged. label May 21, 2024
@karmada-bot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: RainbowMango

The full list of commands accepted by this bot can be found here.

The pull request process is described 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 approved Indicates a PR has been approved by an approver from all required OWNERS files. label May 21, 2024
@karmada-bot karmada-bot merged commit e2b7028 into karmada-io:master May 21, 2024
12 checks passed
@a7i a7i deleted the remove-deploy-revision branch May 21, 2024 12:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. kind/bug Categorizes issue or PR as related to a bug. lgtm Indicates that a PR is ready to be merged. 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.

5 participants