Skip to content

Commit 6c6a702

Browse files
author
Xianglin Gao
committed
kubeadm: delete prepull ds
Signed-off-by: Xianglin Gao <[email protected]>
1 parent d8a513e commit 6c6a702

File tree

5 files changed

+4
-399
lines changed

5 files changed

+4
-399
lines changed

cmd/kubeadm/app/cmd/upgrade/apply.go

Lines changed: 4 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ package upgrade
1818

1919
import (
2020
"fmt"
21-
"time"
2221

2322
"github.com/pkg/errors"
2423
"github.com/spf13/cobra"
@@ -27,18 +26,13 @@ import (
2726
"k8s.io/klog"
2827
kubeadmapi "k8s.io/kubernetes/cmd/kubeadm/app/apis/kubeadm"
2928
"k8s.io/kubernetes/cmd/kubeadm/app/cmd/options"
30-
"k8s.io/kubernetes/cmd/kubeadm/app/constants"
3129
"k8s.io/kubernetes/cmd/kubeadm/app/features"
3230
"k8s.io/kubernetes/cmd/kubeadm/app/phases/upgrade"
3331
kubeadmutil "k8s.io/kubernetes/cmd/kubeadm/app/util"
3432
"k8s.io/kubernetes/cmd/kubeadm/app/util/apiclient"
3533
configutil "k8s.io/kubernetes/cmd/kubeadm/app/util/config"
3634
)
3735

38-
const (
39-
defaultImagePullTimeout = 15 * time.Minute
40-
)
41-
4236
// applyFlags holds the information about the flags that can be passed to apply
4337
type applyFlags struct {
4438
*applyPlanFlags
@@ -48,7 +42,6 @@ type applyFlags struct {
4842
dryRun bool
4943
etcdUpgrade bool
5044
renewCerts bool
51-
imagePullTimeout time.Duration
5245
kustomizeDir string
5346
}
5447

@@ -60,10 +53,9 @@ func (f *applyFlags) sessionIsInteractive() bool {
6053
// NewCmdApply returns the cobra command for `kubeadm upgrade apply`
6154
func NewCmdApply(apf *applyPlanFlags) *cobra.Command {
6255
flags := &applyFlags{
63-
applyPlanFlags: apf,
64-
imagePullTimeout: defaultImagePullTimeout,
65-
etcdUpgrade: true,
66-
renewCerts: true,
56+
applyPlanFlags: apf,
57+
etcdUpgrade: true,
58+
renewCerts: true,
6759
}
6860

6961
cmd := &cobra.Command{
@@ -88,7 +80,6 @@ func NewCmdApply(apf *applyPlanFlags) *cobra.Command {
8880
cmd.Flags().BoolVar(&flags.dryRun, options.DryRun, flags.dryRun, "Do not change any state, just output what actions would be performed.")
8981
cmd.Flags().BoolVar(&flags.etcdUpgrade, "etcd-upgrade", flags.etcdUpgrade, "Perform the upgrade of etcd.")
9082
cmd.Flags().BoolVar(&flags.renewCerts, options.CertificateRenewal, flags.renewCerts, "Perform the renewal of certificates used by component changed during upgrades.")
91-
cmd.Flags().DurationVar(&flags.imagePullTimeout, "image-pull-timeout", flags.imagePullTimeout, "The maximum amount of time to wait for the control plane pods to be downloaded.")
9283
options.AddKustomizePodsFlag(cmd.Flags(), &flags.kustomizeDir)
9384

9485
return cmd
@@ -145,22 +136,7 @@ func runApply(flags *applyFlags, userVersion string) error {
145136
}
146137
}
147138

148-
// Set the timeout as flags.imagePullTimeout to ensure that Prepuller truly respects 'image-pull-timeout' flag
149-
waiter := getWaiter(flags.dryRun, client, flags.imagePullTimeout)
150-
151-
// Use a prepuller implementation based on creating DaemonSets
152-
// and block until all DaemonSets are ready; then we know for sure that all control plane images are cached locally
153-
klog.V(1).Infoln("[upgrade/apply] creating prepuller")
154-
prepuller := upgrade.NewDaemonSetPrepuller(client, waiter, &cfg.ClusterConfiguration)
155-
componentsToPrepull := constants.ControlPlaneComponents
156-
if cfg.Etcd.External == nil && flags.etcdUpgrade {
157-
componentsToPrepull = append(componentsToPrepull, constants.Etcd)
158-
}
159-
if err := upgrade.PrepullImagesInParallel(prepuller, flags.imagePullTimeout, componentsToPrepull); err != nil {
160-
return errors.Wrap(err, "[upgrade/prepull] Failed prepulled the images for the control plane components error")
161-
}
162-
163-
waiter = getWaiter(flags.dryRun, client, upgrade.UpgradeManifestTimeout)
139+
waiter := getWaiter(flags.dryRun, client, upgrade.UpgradeManifestTimeout)
164140

165141
// Now; perform the upgrade procedure
166142
klog.V(1).Infoln("[upgrade/apply] performing upgrade")

cmd/kubeadm/app/constants/constants.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -187,8 +187,6 @@ const (
187187
TLSBootstrapRetryInterval = 5 * time.Second
188188
// PullImageRetry specifies how many times ContainerRuntime retries when pulling image failed
189189
PullImageRetry = 5
190-
// PrepullImagesInParallelTimeout specifies how long kubeadm should wait for prepulling images in parallel before timing out
191-
PrepullImagesInParallelTimeout = 10 * time.Second
192190

193191
// DefaultControlPlaneTimeout specifies the default control plane (actually API Server) timeout for use by kubeadm
194192
DefaultControlPlaneTimeout = 4 * time.Minute

cmd/kubeadm/app/phases/upgrade/BUILD

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ go_library(
88
"policy.go",
99
"postupgrade.go",
1010
"preflight.go",
11-
"prepull.go",
1211
"staticpods.go",
1312
"versiongetter.go",
1413
],
@@ -76,7 +75,6 @@ go_test(
7675
"compute_test.go",
7776
"policy_test.go",
7877
"postupgrade_test.go",
79-
"prepull_test.go",
8078
"staticpods_test.go",
8179
],
8280
embed = [":go_default_library"],

cmd/kubeadm/app/phases/upgrade/prepull.go

Lines changed: 0 additions & 213 deletions
This file was deleted.

0 commit comments

Comments
 (0)