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

Add output to give user awareness of how long timeouts are expected to be #65164

Merged
merged 1 commit into from
Jun 25, 2018

Conversation

xlgao-zju
Copy link
Contributor

@xlgao-zju xlgao-zju commented Jun 16, 2018

What this PR does / why we need it:
Add output to give user awareness of how long manifest upgrade timeout is expected to be.

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
ref kubernetes/kubeadm/#914

Special notes for your reviewer:

Release note:

kubeadm: notify the user of manifest upgrade timeouts

@k8s-ci-robot k8s-ci-robot added release-note-none Denotes a PR that doesn't merit a release note. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Jun 16, 2018
@k8s-ci-robot k8s-ci-robot added area/kubeadm sig/cluster-lifecycle Categorizes an issue or PR as relevant to SIG Cluster Lifecycle. labels Jun 16, 2018
@xlgao-zju
Copy link
Contributor Author

/assign @detiber

@xlgao-zju
Copy link
Contributor Author

/assign @neolit123

@xlgao-zju
Copy link
Contributor Author

ref #64988

@xlgao-zju xlgao-zju force-pushed the add-log-for-timeout branch from 6900f45 to fda81d7 Compare June 16, 2018 15:07
Copy link
Member

@neolit123 neolit123 left a comment

Choose a reason for hiding this comment

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

thanks for having a look a this @xlgao-zju !
i've added a couple of comments.

please, also rename the commit title to be shorter in the lines of:
kubeadm-upgrade: notify the user of manifest upgrade timeouts

if you want to add more information add it in the commit message body.

@@ -194,6 +194,7 @@ func RunApply(flags *applyFlags) error {
// Use a prepuller implementation based on creating DaemonSets
// and block until all DaemonSets are ready; then we know for sure that all control plane images are cached locally
glog.V(1).Infof("[upgrade/apply] creating prepuller")
upgrade.UpgradeManifestTimeout = upgradeManifestTimeout
Copy link
Member

Choose a reason for hiding this comment

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

cmd/upgrade imports phases/upgrade as a backend.
instead of modifying a package global variable in upgrade, why not move the constant to the upgrade package?

also make sure you add a comment on top of global variables / constants.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@neolit123 Since I tried to modify the origin code as less as I could... But this thought seems wrong... 😅

@@ -228,6 +231,7 @@ func upgradeComponent(component string, waiter apiclient.Waiter, pathMgr StaticP

if waitForComponentRestart {
fmt.Println("[upgrade/staticpods] Waiting for the kubelet to restart the component")
fmt.Println("[upgrade/staticpods] This operation will timeout in ", UpgradeManifestTimeout)
Copy link
Member

Choose a reason for hiding this comment

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

we should use Printf():
fmt.Printf("[upgrade/staticpods] This operation will timeout in %v\n", UpgradeManifestTimeout)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ok, but this will print the same thing as what I added...

Copy link
Member

Choose a reason for hiding this comment

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

yes, definitely!
the kubeadm codebase uses Printf() in all places where an argument is printed and Println() if no arguments are printed.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Got you!
So kind you are. Thank you for your help!

@neolit123
Copy link
Member

@xlgao-zju
adding a release note is probably a good idea too:
kubeadm: notify the user of manifest upgrade timeouts

you can modify it in the first message in this PR (under Release note:)

@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. and removed release-note-none Denotes a PR that doesn't merit a release note. labels Jun 16, 2018
@xlgao-zju xlgao-zju force-pushed the add-log-for-timeout branch from fda81d7 to 69be0c9 Compare June 16, 2018 15:59
@k8s-ci-robot k8s-ci-robot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. and removed size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Jun 16, 2018
@xlgao-zju
Copy link
Contributor Author

@xlgao-zju
adding a release note is probably a good idea too:
kubeadm: notify the user of manifest upgrade timeouts

Added

@neolit123
Copy link
Member

thanks @xlgao-zju !
@detiber wdyt?

@@ -228,6 +233,7 @@ func upgradeComponent(component string, waiter apiclient.Waiter, pathMgr StaticP

if waitForComponentRestart {
fmt.Println("[upgrade/staticpods] Waiting for the kubelet to restart the component")
fmt.Printf("[upgrade/staticpods] This operation will timeout in %v\n", UpgradeManifestTimeout)
Copy link
Member

Choose a reason for hiding this comment

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

why not just alter message above to add timeout value ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@kad updated

@xlgao-zju xlgao-zju force-pushed the add-log-for-timeout branch from 69be0c9 to 4b8b73f Compare June 18, 2018 15:05
@xlgao-zju
Copy link
Contributor Author

@kad updated

Copy link
Member

@detiber detiber left a comment

Choose a reason for hiding this comment

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

@xlgao-zju This looks great, thanks. I would like to keep the original linked issue open, since there are still other timeouts that we do not provide user output for as well, though.

@xlgao-zju
Copy link
Contributor Author

xlgao-zju commented Jun 19, 2018

@detiber Yes, I think we can merge this PR. And then we should figure out where we should add the output. Before we call the function in waiter or somewhere else?

@detiber
Copy link
Member

detiber commented Jun 19, 2018

@xlgao-zju yes, adding some type of output in waiter was my thought as well.

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jun 19, 2018
@xlgao-zju
Copy link
Contributor Author

@detiber Yes, we can add a TODO list in the original issue to track all the output we should add.

@timothysc need your approve...

@rosti
Copy link
Contributor

rosti commented Jun 19, 2018

Should we place UpgradeManifestTimeout in consts.go?

@neolit123
Copy link
Member

@rosti
i think consts.go is a good option too. possibly depends if a constant is used more globally.
i would leave for others to comment on that.

@xlgao-zju
Copy link
Contributor Author

@neolit123 +1 for possibly depends if a constant is used more globally.

@xlgao-zju
Copy link
Contributor Author

/assign @fabriziopandini
/assign @timothysc
PTAL

Copy link
Member

@fabriziopandini fabriziopandini left a comment

Choose a reason for hiding this comment

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

@xlgao-zju thanks for this PR!
I'm fine why your proposal, with a simple request of improvement on the message for bettet consistency with the overall kubeadm UX.
@neolit123 @detiber feel free to improve the message

@xlgao-zju
Copy link
Contributor Author

@fabriziopandini Hi, I am not quiet understand your requirement... Cloud you make it more clearer, os I can improve this PR. Or cloud you explain the overall kubeadm UX for me, I'd like to learn this. 😆

@xlgao-zju
Copy link
Contributor Author

with a simple request of improvement on the message for bettet consistency with the overall kubeadm UX.

@neolit123 Cloud you take another look at this? How could I improve this PR?

@neolit123
Copy link
Member

@fabriziopandini can you please elaborate on how to improve the message? :)

@@ -227,7 +232,7 @@ func upgradeComponent(component string, waiter apiclient.Waiter, pathMgr StaticP
fmt.Printf("[upgrade/staticpods] Moved new manifest to %q and backed up old manifest to %q\n", currentManifestPath, backupManifestPath)

if waitForComponentRestart {
fmt.Println("[upgrade/staticpods] Waiting for the kubelet to restart the component")
fmt.Printf("[upgrade/staticpods] Waiting for the kubelet to restart the component. This operation will timeout in %v\n", UpgradeManifestTimeout)

Copy link
Member

Choose a reason for hiding this comment

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

@xlgao-zju sorry I forgot to clck add comment 😶
Please make this more consistent with other kubeadm Wait messages e.g.

fmt.Printf("[upgrade/staticpods] Waiting for the kubelet to restart the component")
fmt.Printf("[upgrade/staticpods] This might take a minute or longer depending on the component/version gap (timeout %v\n", UpgradeManifestTimeout)

This includes a short reassuring description about what Kubeadm is doing and why the user should wait (in this case I suggest a generic note)

@xlgao-zju xlgao-zju force-pushed the add-log-for-timeout branch from 4b8b73f to ad5abab Compare June 25, 2018 16:00
@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jun 25, 2018
Signed-off-by: Xianglin Gao <xianglin.gxl@alibaba-inc.com>
@xlgao-zju xlgao-zju force-pushed the add-log-for-timeout branch from ad5abab to b309ace Compare June 25, 2018 16:03
@xlgao-zju
Copy link
Contributor Author

@fabriziopandini updated.

@neolit123 @detiber As I said, we can add a TODO list in kubernetes/kubeadm/#914. In that TODO list, We can add all the places where we should print the similar log. And we can use this PR as an example.
wdyt?

@detiber
Copy link
Member

detiber commented Jun 25, 2018

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jun 25, 2018
@xlgao-zju
Copy link
Contributor Author

@fabriziopandini need your approve

Copy link
Member

@timothysc timothysc left a comment

Choose a reason for hiding this comment

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

/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: detiber, timothysc, xlgao-zju

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

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jun 25, 2018
@k8s-github-robot
Copy link

Automatic merge from submit-queue (batch tested with PRs 65164, 65258). If you want to cherry-pick this change to another branch, please follow the instructions here.

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. area/kubeadm cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. release-note Denotes a PR that will be considered when it comes time to generate release notes. sig/cluster-lifecycle Categorizes an issue or PR as relevant to SIG Cluster Lifecycle. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants