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

check deployment statefulset rollout not use check pod ready #3221

Merged
merged 1 commit into from
Mar 16, 2023

Conversation

yanfeng1992
Copy link
Member

@yanfeng1992 yanfeng1992 commented Feb 28, 2023

What type of PR is this?
/kind cleanup

What this PR does / why we need it:

Now the way to check the karmada component is to traverse all the pods according to the label. I think this way is not perfect, and when the for loop checks, the set timeout time is not accurate.

Which issue(s) this PR fixes:
Fixes #

Special notes for your reviewer:

Does this PR introduce a user-facing change?:

NONE

@karmada-bot karmada-bot added the kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. label Feb 28, 2023
@karmada-bot karmada-bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Feb 28, 2023
@codecov-commenter
Copy link

codecov-commenter commented Feb 28, 2023

Codecov Report

Merging #3221 (ab4e1cf) into master (51fbbb0) will increase coverage by 0.01%.
The diff coverage is 0.00%.

❗ Current head ab4e1cf differs from pull request most recent head b7b0116. Consider uploading reports for the commit b7b0116 to get more accurate results

📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more

@@            Coverage Diff             @@
##           master    #3221      +/-   ##
==========================================
+ Coverage   49.06%   49.07%   +0.01%     
==========================================
  Files         203      203              
  Lines       18354    18352       -2     
==========================================
+ Hits         9005     9007       +2     
+ Misses       8859     8856       -3     
+ Partials      490      489       -1     
Flag Coverage Δ
unittests 49.07% <0.00%> (+0.01%) ⬆️

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

Impacted Files Coverage Δ
pkg/karmadactl/cmdinit/kubernetes/check.go 0.00% <0.00%> (ø)
pkg/karmadactl/cmdinit/kubernetes/deploy.go 7.46% <0.00%> (-0.08%) ⬇️
pkg/search/proxy/store/util.go 92.41% <0.00%> (-0.48%) ⬇️
pkg/util/worker.go 71.42% <0.00%> (+4.76%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@calvin0327
Copy link

calvin0327 commented Feb 28, 2023

and when the for loop checks, the set timeout time is not accurate

@yanfeng1992 why the timeout is not accurate? I don't understand. could you explain that?

@yanfeng1992 yanfeng1992 force-pushed the wait-dep-sts-rollout branch 3 times, most recently from b7b0116 to 2da8c8a Compare February 28, 2023 08:57
@yanfeng1992
Copy link
Member Author

When checking circularly, if the deployment has three replicas, check them serially in order. After checking the first pod, hasn’t the second pod been created for a while? @calvin0327

pkg/karmadactl/cmdinit/kubernetes/check.go Outdated Show resolved Hide resolved
pkg/karmadactl/cmdinit/kubernetes/check.go Outdated Show resolved Hide resolved
pkg/karmadactl/cmdinit/kubernetes/deploy.go Outdated Show resolved Hide resolved
pkg/karmadactl/cmdinit/kubernetes/deploy.go Outdated Show resolved Hide resolved
@yanfeng1992
Copy link
Member Author

Does the WaitPodReadyTimeout here work? It feels like it can be removed. @jwcesign

@jwcesign
Copy link
Member

jwcesign commented Mar 1, 2023

Does the WaitPodReadyTimeout here work? It feels like it can be removed?

Looks like no place uses this, cc @lonelyCZ for checking

@wuyingjun-lucky
Copy link
Member

What about move check.go to kamadactl/utils

@yanfeng1992
Copy link
Member Author

yanfeng1992 commented Mar 3, 2023

Can you confirm these two questions?

1.What about move check.go to kamadactl/utils

2.

Does the WaitPodReadyTimeout here work? It feels like it can be removed.

@lonelyCZ @wuyingjun-lucky @jwcesign

@wuyingjun-lucky
Copy link
Member

wuyingjun-lucky commented Mar 7, 2023

Can you confirm these two questions?

1.What about move check.go to kamadactl/utils

Does the WaitPodReadyTimeout here work? It feels like it can be removed.

@lonelyCZ @wuyingjun-lucky @jwcesign

1 sorry my mistake. I mean kamadactl/util
2 Yes. we can clear it up.

@yanfeng1992
Copy link
Member Author

Can you confirm these two questions?
1.What about move check.go to kamadactl/utils

Does the WaitPodReadyTimeout here work? It feels like it can be removed.
@lonelyCZ @wuyingjun-lucky @jwcesign

1 sorry my mistake. I mean kamadactl/util 2 Yes. we can clear it up.

@wuyingjun-lucky I solved these two problems

@wuyingjun-lucky
Copy link
Member

LGTM
/cc @lonelyCZ
Do you have tests for these two commands ? @yanfeng1992

@yanfeng1992
Copy link
Member Author

Please have a look @lonelyCZ

@lonelyCZ
Copy link
Member

I'm sorry I missed that. I will look it ASAP.

/assign

@yanfeng1992 yanfeng1992 force-pushed the wait-dep-sts-rollout branch 2 times, most recently from 29e9d9e to 51c13c5 Compare March 15, 2023 02:21
pkg/karmadactl/util/check.go Show resolved Hide resolved
pkg/karmadactl/util/check.go Outdated Show resolved Hide resolved
@jwcesign
Copy link
Member

/lgtm

@karmada-bot karmada-bot added the lgtm Indicates that a PR is ready to be merged. label Mar 15, 2023
@lonelyCZ
Copy link
Member

Thanks @yanfeng1992 , I just tested it that worked fine.

cc @RainbowMango

@RainbowMango
Copy link
Member

/assign

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.

It makes sense to me that wait for StatefulSet and Deployment ready instead of the Pod. It's more straightforward.

I suggest letting this PR focus on using WaitForStatefulsetRollout and WaitForDeploymentRollout to replace WaitPodReady, and don't touch any flags.

Please send another PR to handle the flags particularly if you think it needs to, so that we can add more clear release notes to users.

pkg/karmadactl/util/check.go Outdated Show resolved Hide resolved
pkg/karmadactl/util/check.go Outdated Show resolved Hide resolved
pkg/karmadactl/util/check.go Outdated Show resolved Hide resolved
pkg/karmadactl/util/check.go Outdated Show resolved Hide resolved
pkg/karmadactl/util/check.go Outdated Show resolved Hide resolved
@karmada-bot karmada-bot removed the lgtm Indicates that a PR is ready to be merged. label Mar 16, 2023
@yanfeng1992
Copy link
Member Author

@RainbowMango @lonelyCZ Please take a look at the latest commit

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.

Only some nits, otherwise LGTM.
Thanks.

pkg/karmadactl/util/check.go Outdated Show resolved Hide resolved
pkg/karmadactl/util/check.go Outdated Show resolved Hide resolved
Signed-off-by: huangyanfeng <huangyanfeng1992@gmail.com>
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
Thanks for your quick response.

@karmada-bot karmada-bot added the lgtm Indicates that a PR is ready to be merged. label Mar 16, 2023
@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 Mar 16, 2023
@karmada-bot karmada-bot merged commit 7f5bb9d into karmada-io:master Mar 16, 2023
@yanfeng1992 yanfeng1992 deleted the wait-dep-sts-rollout branch April 2, 2024 12:47
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/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. lgtm Indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

8 participants