Skip to content

Commit 0714f81

Browse files
committed
kubeadm: remove 'kubeadm alpha kubelet config download'
1 parent 0f13c5c commit 0714f81

File tree

2 files changed

+0
-57
lines changed

2 files changed

+0
-57
lines changed

cmd/kubeadm/app/cmd/alpha/BUILD

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ go_library(
2626
"//cmd/kubeadm/app/phases/kubeconfig:go_default_library",
2727
"//cmd/kubeadm/app/phases/kubelet:go_default_library",
2828
"//cmd/kubeadm/app/phases/selfhosting:go_default_library",
29-
"//cmd/kubeadm/app/preflight:go_default_library",
3029
"//cmd/kubeadm/app/util/apiclient:go_default_library",
3130
"//cmd/kubeadm/app/util/config:go_default_library",
3231
"//cmd/kubeadm/app/util/kubeconfig:go_default_library",
@@ -35,7 +34,6 @@ go_library(
3534
"//vendor/github.com/lithammer/dedent:go_default_library",
3635
"//vendor/github.com/pkg/errors:go_default_library",
3736
"//vendor/github.com/spf13/cobra:go_default_library",
38-
"//vendor/k8s.io/utils/exec:go_default_library",
3937
],
4038
)
4139

cmd/kubeadm/app/cmd/alpha/kubelet.go

Lines changed: 0 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -26,26 +26,10 @@ import (
2626
cmdutil "k8s.io/kubernetes/cmd/kubeadm/app/cmd/util"
2727
"k8s.io/kubernetes/cmd/kubeadm/app/constants"
2828
kubeletphase "k8s.io/kubernetes/cmd/kubeadm/app/phases/kubelet"
29-
"k8s.io/kubernetes/cmd/kubeadm/app/preflight"
3029
kubeconfigutil "k8s.io/kubernetes/cmd/kubeadm/app/util/kubeconfig"
31-
utilsexec "k8s.io/utils/exec"
3230
)
3331

3432
var (
35-
kubeletConfigDownloadLongDesc = cmdutil.LongDesc(`
36-
Download the kubelet configuration from a ConfigMap of the form "kubelet-config-1.X" in the cluster,
37-
where X is the minor version of the kubelet. Either kubeadm autodetects the kubelet version by exec-ing
38-
"kubelet --version" or respects the --kubelet-version parameter.
39-
` + cmdutil.AlphaDisclaimer)
40-
41-
kubeletConfigDownloadExample = cmdutil.Examples(fmt.Sprintf(`
42-
# Download the kubelet configuration from the ConfigMap in the cluster. Autodetect the kubelet version.
43-
kubeadm alpha kubelet config download
44-
45-
# Download the kubelet configuration from the ConfigMap in the cluster. Use a specific desired kubelet version.
46-
kubeadm alpha kubelet config download --kubelet-version %s
47-
`, constants.CurrentKubernetesVersion))
48-
4933
kubeletConfigEnableDynamicLongDesc = cmdutil.LongDesc(`
5034
Enable or update dynamic kubelet configuration for a Node, against the kubelet-config-1.X ConfigMap in the cluster,
5135
where X is the minor version of the desired kubelet version.
@@ -84,49 +68,10 @@ func newCmdKubeletConfig() *cobra.Command {
8468
Long: cmdutil.MacroCommandLongDescription,
8569
}
8670

87-
cmd.AddCommand(newCmdKubeletConfigDownload())
8871
cmd.AddCommand(newCmdKubeletConfigEnableDynamic())
8972
return cmd
9073
}
9174

92-
// newCmdKubeletConfigDownload calls cobra.Command for downloading the kubelet configuration from the kubelet-config-1.X ConfigMap in the cluster
93-
func newCmdKubeletConfigDownload() *cobra.Command {
94-
var kubeletVersionStr string
95-
// TODO: Be smarter about this and be able to load multiple kubeconfig files in different orders of precedence
96-
kubeConfigFile := constants.GetKubeletKubeConfigPath()
97-
98-
cmd := &cobra.Command{
99-
Use: "download",
100-
Short: "Download the kubelet configuration from the cluster ConfigMap kubelet-config-1.X, where X is the minor version of the kubelet",
101-
Long: kubeletConfigDownloadLongDesc,
102-
Example: kubeletConfigDownloadExample,
103-
RunE: func(cmd *cobra.Command, args []string) error {
104-
kubeletVersion, err := getKubeletVersion(kubeletVersionStr)
105-
if err != nil {
106-
return err
107-
}
108-
109-
client, err := kubeconfigutil.ClientSetFromFile(kubeConfigFile)
110-
if err != nil {
111-
return err
112-
}
113-
114-
return kubeletphase.DownloadConfig(client, kubeletVersion, constants.KubeletRunDirectory)
115-
},
116-
}
117-
118-
options.AddKubeConfigFlag(cmd.Flags(), &kubeConfigFile)
119-
cmd.Flags().StringVar(&kubeletVersionStr, "kubelet-version", kubeletVersionStr, "The desired version for the kubelet. Defaults to being autodetected from 'kubelet --version'.")
120-
return cmd
121-
}
122-
123-
func getKubeletVersion(kubeletVersionStr string) (*version.Version, error) {
124-
if len(kubeletVersionStr) > 0 {
125-
return version.ParseSemantic(kubeletVersionStr)
126-
}
127-
return preflight.GetKubeletVersion(utilsexec.New())
128-
}
129-
13075
// newCmdKubeletConfigEnableDynamic calls cobra.Command for enabling dynamic kubelet configuration on node
13176
// This feature is still in alpha and an experimental state
13277
func newCmdKubeletConfigEnableDynamic() *cobra.Command {

0 commit comments

Comments
 (0)