From b309ace7934fce82c009873b894c4a677d5dabfe Mon Sep 17 00:00:00 2001 From: Xianglin Gao Date: Sat, 16 Jun 2018 22:02:47 +0800 Subject: [PATCH] kubeadm-upgrade: notify the user of manifest upgrade timeouts Signed-off-by: Xianglin Gao --- cmd/kubeadm/app/cmd/upgrade/apply.go | 2 -- cmd/kubeadm/app/cmd/upgrade/common.go | 2 +- cmd/kubeadm/app/phases/upgrade/staticpods.go | 6 ++++++ 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/cmd/kubeadm/app/cmd/upgrade/apply.go b/cmd/kubeadm/app/cmd/upgrade/apply.go index e5922edb97a..326f3329cd8 100644 --- a/cmd/kubeadm/app/cmd/upgrade/apply.go +++ b/cmd/kubeadm/app/cmd/upgrade/apply.go @@ -42,8 +42,6 @@ import ( ) const ( - upgradeManifestTimeout = 5 * time.Minute - defaultImagePullTimeout = 15 * time.Minute ) diff --git a/cmd/kubeadm/app/cmd/upgrade/common.go b/cmd/kubeadm/app/cmd/upgrade/common.go index 9480c46611f..2769d2e2fb1 100644 --- a/cmd/kubeadm/app/cmd/upgrade/common.go +++ b/cmd/kubeadm/app/cmd/upgrade/common.go @@ -178,7 +178,7 @@ func getWaiter(dryRun bool, client clientset.Interface) apiclient.Waiter { if dryRun { return dryrunutil.NewWaiter() } - return apiclient.NewKubeWaiter(client, upgradeManifestTimeout, os.Stdout) + return apiclient.NewKubeWaiter(client, upgrade.UpgradeManifestTimeout, os.Stdout) } // InteractivelyConfirmUpgrade asks the user whether they _really_ want to upgrade. diff --git a/cmd/kubeadm/app/phases/upgrade/staticpods.go b/cmd/kubeadm/app/phases/upgrade/staticpods.go index 33b1a0dae8a..9055a4e64b3 100644 --- a/cmd/kubeadm/app/phases/upgrade/staticpods.go +++ b/cmd/kubeadm/app/phases/upgrade/staticpods.go @@ -33,6 +33,11 @@ import ( "k8s.io/kubernetes/pkg/util/version" ) +const ( + // UpgradeManifestTimeout is timeout of upgrading the static pod manifest + UpgradeManifestTimeout = 5 * time.Minute +) + // StaticPodPathManager is responsible for tracking the directories used in the static pod upgrade transition type StaticPodPathManager interface { // MoveFile should move a file from oldPath to newPath @@ -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 might take a minute or longer depending on the component/version gap (timeout %v\n", UpgradeManifestTimeout) // Wait for the mirror Pod hash to change; otherwise we'll run into race conditions here when the kubelet hasn't had time to // notice the removal of the Static Pod, leading to a false positive below where we check that the API endpoint is healthy