mirror of https://github.com/k3s-io/k3s
Merge pull request #76638 from SataQiu/clean-command-kubeadm-20190416
[kubeadm] clean up command description information for consistency and readabilityk3s-v1.15.3
commit
a404238d1c
|
@ -34,12 +34,12 @@ import (
|
||||||
|
|
||||||
var (
|
var (
|
||||||
genericLongDesc = normalizer.LongDesc(`
|
genericLongDesc = normalizer.LongDesc(`
|
||||||
Renews the %[1]s, and saves them into %[2]s.cert and %[2]s.key files.
|
Renew the %[1]s, and save them into %[2]s.cert and %[2]s.key files.
|
||||||
|
|
||||||
Extra attributes such as SANs will be based on the existing certificates, there is no need to resupply them.
|
Extra attributes such as SANs will be based on the existing certificates, there is no need to resupply them.
|
||||||
`)
|
`)
|
||||||
allLongDesc = normalizer.LongDesc(`
|
allLongDesc = normalizer.LongDesc(`
|
||||||
Renews all known certificates necessary to run the control plane. Renewals are run unconditionally, regardless
|
Renew all known certificates necessary to run the control plane. Renewals are run unconditionally, regardless
|
||||||
of expiration date. Renewals can also be run individually for more control.
|
of expiration date. Renewals can also be run individually for more control.
|
||||||
`)
|
`)
|
||||||
)
|
)
|
||||||
|
@ -60,7 +60,7 @@ func newCmdCertsUtility() *cobra.Command {
|
||||||
func newCmdCertsRenewal() *cobra.Command {
|
func newCmdCertsRenewal() *cobra.Command {
|
||||||
cmd := &cobra.Command{
|
cmd := &cobra.Command{
|
||||||
Use: "renew",
|
Use: "renew",
|
||||||
Short: "Renews certificates for a Kubernetes cluster",
|
Short: "Renew certificates for a Kubernetes cluster",
|
||||||
Long: cmdutil.MacroCommandLongDescription,
|
Long: cmdutil.MacroCommandLongDescription,
|
||||||
RunE: cmdutil.SubCmdRunE("renew"),
|
RunE: cmdutil.SubCmdRunE("renew"),
|
||||||
}
|
}
|
||||||
|
@ -107,7 +107,7 @@ func getRenewSubCommands() []*cobra.Command {
|
||||||
|
|
||||||
allCmd := &cobra.Command{
|
allCmd := &cobra.Command{
|
||||||
Use: "all",
|
Use: "all",
|
||||||
Short: "renew all available certificates",
|
Short: "Renew all available certificates",
|
||||||
Long: allLongDesc,
|
Long: allLongDesc,
|
||||||
Run: func(*cobra.Command, []string) {
|
Run: func(*cobra.Command, []string) {
|
||||||
for _, f := range funcList {
|
for _, f := range funcList {
|
||||||
|
@ -156,7 +156,7 @@ func generateRenewalFunction(cert *certsphase.KubeadmCert, caCert *certsphase.Ku
|
||||||
func generateRenewalCommand(cert *certsphase.KubeadmCert, cfg *renewConfig) *cobra.Command {
|
func generateRenewalCommand(cert *certsphase.KubeadmCert, cfg *renewConfig) *cobra.Command {
|
||||||
cmd := &cobra.Command{
|
cmd := &cobra.Command{
|
||||||
Use: cert.Name,
|
Use: cert.Name,
|
||||||
Short: fmt.Sprintf("Generates the %s", cert.LongName),
|
Short: fmt.Sprintf("Generate the %s", cert.LongName),
|
||||||
Long: fmt.Sprintf(genericLongDesc, cert.LongName, cert.BaseName),
|
Long: fmt.Sprintf(genericLongDesc, cert.LongName, cert.BaseName),
|
||||||
}
|
}
|
||||||
addFlags(cmd, cfg)
|
addFlags(cmd, cfg)
|
||||||
|
|
|
@ -37,11 +37,11 @@ var (
|
||||||
` + cmdutil.AlphaDisclaimer)
|
` + cmdutil.AlphaDisclaimer)
|
||||||
|
|
||||||
userKubeconfigLongDesc = normalizer.LongDesc(`
|
userKubeconfigLongDesc = normalizer.LongDesc(`
|
||||||
Outputs a kubeconfig file for an additional user.
|
Output a kubeconfig file for an additional user.
|
||||||
` + cmdutil.AlphaDisclaimer)
|
` + cmdutil.AlphaDisclaimer)
|
||||||
|
|
||||||
userKubeconfigExample = normalizer.Examples(`
|
userKubeconfigExample = normalizer.Examples(`
|
||||||
# Outputs a kubeconfig file for an additional user named foo
|
# Output a kubeconfig file for an additional user named foo
|
||||||
kubeadm alpha kubeconfig user --client-name=foo
|
kubeadm alpha kubeconfig user --client-name=foo
|
||||||
`)
|
`)
|
||||||
)
|
)
|
||||||
|
@ -72,7 +72,7 @@ func newCmdUserKubeConfig(out io.Writer) *cobra.Command {
|
||||||
// Creates the UX Command
|
// Creates the UX Command
|
||||||
cmd := &cobra.Command{
|
cmd := &cobra.Command{
|
||||||
Use: "user",
|
Use: "user",
|
||||||
Short: "Outputs a kubeconfig file for an additional user",
|
Short: "Output a kubeconfig file for an additional user",
|
||||||
Long: userKubeconfigLongDesc,
|
Long: userKubeconfigLongDesc,
|
||||||
Example: userKubeconfigExample,
|
Example: userKubeconfigExample,
|
||||||
Run: func(cmd *cobra.Command, args []string) {
|
Run: func(cmd *cobra.Command, args []string) {
|
||||||
|
|
|
@ -35,21 +35,21 @@ import (
|
||||||
|
|
||||||
var (
|
var (
|
||||||
kubeletConfigDownloadLongDesc = normalizer.LongDesc(`
|
kubeletConfigDownloadLongDesc = normalizer.LongDesc(`
|
||||||
Downloads the kubelet configuration from a ConfigMap of the form "kubelet-config-1.X" in the cluster,
|
Download the kubelet configuration from a ConfigMap of the form "kubelet-config-1.X" in the cluster,
|
||||||
where X is the minor version of the kubelet. Either kubeadm autodetects the kubelet version by exec-ing
|
where X is the minor version of the kubelet. Either kubeadm autodetects the kubelet version by exec-ing
|
||||||
"kubelet --version" or respects the --kubelet-version parameter.
|
"kubelet --version" or respects the --kubelet-version parameter.
|
||||||
` + cmdutil.AlphaDisclaimer)
|
` + cmdutil.AlphaDisclaimer)
|
||||||
|
|
||||||
kubeletConfigDownloadExample = normalizer.Examples(fmt.Sprintf(`
|
kubeletConfigDownloadExample = normalizer.Examples(fmt.Sprintf(`
|
||||||
# Downloads the kubelet configuration from the ConfigMap in the cluster. Autodetects the kubelet version.
|
# Download the kubelet configuration from the ConfigMap in the cluster. Autodetect the kubelet version.
|
||||||
kubeadm alpha phase kubelet config download
|
kubeadm alpha phase kubelet config download
|
||||||
|
|
||||||
# Downloads the kubelet configuration from the ConfigMap in the cluster. Uses a specific desired kubelet version.
|
# Download the kubelet configuration from the ConfigMap in the cluster. Use a specific desired kubelet version.
|
||||||
kubeadm alpha phase kubelet config download --kubelet-version %s
|
kubeadm alpha phase kubelet config download --kubelet-version %s
|
||||||
`, constants.CurrentKubernetesVersion))
|
`, constants.CurrentKubernetesVersion))
|
||||||
|
|
||||||
kubeletConfigEnableDynamicLongDesc = normalizer.LongDesc(`
|
kubeletConfigEnableDynamicLongDesc = normalizer.LongDesc(`
|
||||||
Enables or updates dynamic kubelet configuration for a Node, against the kubelet-config-1.X ConfigMap in the cluster,
|
Enable or update dynamic kubelet configuration for a Node, against the kubelet-config-1.X ConfigMap in the cluster,
|
||||||
where X is the minor version of the desired kubelet version.
|
where X is the minor version of the desired kubelet version.
|
||||||
|
|
||||||
WARNING: This feature is still experimental, and disabled by default. Enable only if you know what you are doing, as it
|
WARNING: This feature is still experimental, and disabled by default. Enable only if you know what you are doing, as it
|
||||||
|
@ -58,7 +58,7 @@ var (
|
||||||
` + cmdutil.AlphaDisclaimer)
|
` + cmdutil.AlphaDisclaimer)
|
||||||
|
|
||||||
kubeletConfigEnableDynamicExample = normalizer.Examples(fmt.Sprintf(`
|
kubeletConfigEnableDynamicExample = normalizer.Examples(fmt.Sprintf(`
|
||||||
# Enables dynamic kubelet configuration for a Node.
|
# Enable dynamic kubelet configuration for a Node.
|
||||||
kubeadm alpha phase kubelet enable-dynamic-config --node-name node-1 --kubelet-version %s
|
kubeadm alpha phase kubelet enable-dynamic-config --node-name node-1 --kubelet-version %s
|
||||||
|
|
||||||
WARNING: This feature is still experimental, and disabled by default. Enable only if you know what you are doing, as it
|
WARNING: This feature is still experimental, and disabled by default. Enable only if you know what you are doing, as it
|
||||||
|
@ -99,7 +99,7 @@ func newCmdKubeletConfigDownload() *cobra.Command {
|
||||||
|
|
||||||
cmd := &cobra.Command{
|
cmd := &cobra.Command{
|
||||||
Use: "download",
|
Use: "download",
|
||||||
Short: "Downloads the kubelet configuration from the cluster ConfigMap kubelet-config-1.X, where X is the minor version of the kubelet.",
|
Short: "Download the kubelet configuration from the cluster ConfigMap kubelet-config-1.X, where X is the minor version of the kubelet",
|
||||||
Long: kubeletConfigDownloadLongDesc,
|
Long: kubeletConfigDownloadLongDesc,
|
||||||
Example: kubeletConfigDownloadExample,
|
Example: kubeletConfigDownloadExample,
|
||||||
Run: func(cmd *cobra.Command, args []string) {
|
Run: func(cmd *cobra.Command, args []string) {
|
||||||
|
@ -134,7 +134,7 @@ func newCmdKubeletConfigEnableDynamic() *cobra.Command {
|
||||||
|
|
||||||
cmd := &cobra.Command{
|
cmd := &cobra.Command{
|
||||||
Use: "enable-dynamic",
|
Use: "enable-dynamic",
|
||||||
Short: "EXPERIMENTAL: Enables or updates dynamic kubelet configuration for a Node",
|
Short: "EXPERIMENTAL: Enable or update dynamic kubelet configuration for a Node",
|
||||||
Long: kubeletConfigEnableDynamicLongDesc,
|
Long: kubeletConfigEnableDynamicLongDesc,
|
||||||
Example: kubeletConfigEnableDynamicExample,
|
Example: kubeletConfigEnableDynamicExample,
|
||||||
Run: func(cmd *cobra.Command, args []string) {
|
Run: func(cmd *cobra.Command, args []string) {
|
||||||
|
|
|
@ -46,14 +46,14 @@ import (
|
||||||
|
|
||||||
var (
|
var (
|
||||||
selfhostingLongDesc = normalizer.LongDesc(`
|
selfhostingLongDesc = normalizer.LongDesc(`
|
||||||
Converts static Pod files for control plane components into self-hosted DaemonSets configured via the Kubernetes API.
|
Convert static Pod files for control plane components into self-hosted DaemonSets configured via the Kubernetes API.
|
||||||
|
|
||||||
See the documentation for self-hosting limitations.
|
See the documentation for self-hosting limitations.
|
||||||
|
|
||||||
` + cmdutil.AlphaDisclaimer)
|
` + cmdutil.AlphaDisclaimer)
|
||||||
|
|
||||||
selfhostingExample = normalizer.Examples(`
|
selfhostingExample = normalizer.Examples(`
|
||||||
# Converts a static Pod-hosted control plane into a self-hosted one.
|
# Convert a static Pod-hosted control plane into a self-hosted one.
|
||||||
|
|
||||||
kubeadm alpha phase self-hosting convert-from-staticpods
|
kubeadm alpha phase self-hosting convert-from-staticpods
|
||||||
`)
|
`)
|
||||||
|
@ -64,7 +64,7 @@ func NewCmdSelfhosting(in io.Reader) *cobra.Command {
|
||||||
cmd := &cobra.Command{
|
cmd := &cobra.Command{
|
||||||
Use: "selfhosting",
|
Use: "selfhosting",
|
||||||
Aliases: []string{"selfhosted", "self-hosting"},
|
Aliases: []string{"selfhosted", "self-hosting"},
|
||||||
Short: "Makes a kubeadm cluster self-hosted",
|
Short: "Make a kubeadm cluster self-hosted",
|
||||||
Long: cmdutil.MacroCommandLongDescription,
|
Long: cmdutil.MacroCommandLongDescription,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -86,7 +86,7 @@ func getSelfhostingSubCommand(in io.Reader) *cobra.Command {
|
||||||
cmd := &cobra.Command{
|
cmd := &cobra.Command{
|
||||||
Use: "pivot",
|
Use: "pivot",
|
||||||
Aliases: []string{"from-staticpods"},
|
Aliases: []string{"from-staticpods"},
|
||||||
Short: "Converts a static Pod-hosted control plane into a self-hosted one",
|
Short: "Convert a static Pod-hosted control plane into a self-hosted one",
|
||||||
Long: selfhostingLongDesc,
|
Long: selfhostingLongDesc,
|
||||||
Example: selfhostingExample,
|
Example: selfhostingExample,
|
||||||
Run: func(cmd *cobra.Command, args []string) {
|
Run: func(cmd *cobra.Command, args []string) {
|
||||||
|
|
|
@ -102,7 +102,7 @@ func GetSupportedShells() []string {
|
||||||
func NewCmdCompletion(out io.Writer, boilerPlate string) *cobra.Command {
|
func NewCmdCompletion(out io.Writer, boilerPlate string) *cobra.Command {
|
||||||
cmd := &cobra.Command{
|
cmd := &cobra.Command{
|
||||||
Use: "completion SHELL",
|
Use: "completion SHELL",
|
||||||
Short: "Output shell completion code for the specified shell (bash or zsh).",
|
Short: "Output shell completion code for the specified shell (bash or zsh)",
|
||||||
Long: completionLong,
|
Long: completionLong,
|
||||||
Example: completionExample,
|
Example: completionExample,
|
||||||
Run: func(cmd *cobra.Command, args []string) {
|
Run: func(cmd *cobra.Command, args []string) {
|
||||||
|
|
|
@ -64,7 +64,7 @@ func NewCmdConfig(out io.Writer) *cobra.Command {
|
||||||
|
|
||||||
cmd := &cobra.Command{
|
cmd := &cobra.Command{
|
||||||
Use: "config",
|
Use: "config",
|
||||||
Short: "Manage configuration for a kubeadm cluster persisted in a ConfigMap in the cluster.",
|
Short: "Manage configuration for a kubeadm cluster persisted in a ConfigMap in the cluster",
|
||||||
Long: fmt.Sprintf(dedent.Dedent(`
|
Long: fmt.Sprintf(dedent.Dedent(`
|
||||||
There is a ConfigMap in the %s namespace called %q that kubeadm uses to store internal configuration about the
|
There is a ConfigMap in the %s namespace called %q that kubeadm uses to store internal configuration about the
|
||||||
cluster. kubeadm CLI v1.8.0+ automatically creates this ConfigMap with the config used with 'kubeadm init', but if you
|
cluster. kubeadm CLI v1.8.0+ automatically creates this ConfigMap with the config used with 'kubeadm init', but if you
|
||||||
|
@ -223,7 +223,7 @@ func NewCmdConfigMigrate(out io.Writer) *cobra.Command {
|
||||||
var oldCfgPath, newCfgPath string
|
var oldCfgPath, newCfgPath string
|
||||||
cmd := &cobra.Command{
|
cmd := &cobra.Command{
|
||||||
Use: "migrate",
|
Use: "migrate",
|
||||||
Short: "Read an older version of the kubeadm configuration API types from a file, and output the similar config object for the newer version.",
|
Short: "Read an older version of the kubeadm configuration API types from a file, and output the similar config object for the newer version",
|
||||||
Long: fmt.Sprintf(dedent.Dedent(`
|
Long: fmt.Sprintf(dedent.Dedent(`
|
||||||
This command lets you convert configuration objects of older versions to the latest supported version,
|
This command lets you convert configuration objects of older versions to the latest supported version,
|
||||||
locally in the CLI tool without ever touching anything in the cluster.
|
locally in the CLI tool without ever touching anything in the cluster.
|
||||||
|
@ -267,7 +267,7 @@ func NewCmdConfigMigrate(out io.Writer) *cobra.Command {
|
||||||
func NewCmdConfigUpload(out io.Writer, kubeConfigFile *string) *cobra.Command {
|
func NewCmdConfigUpload(out io.Writer, kubeConfigFile *string) *cobra.Command {
|
||||||
cmd := &cobra.Command{
|
cmd := &cobra.Command{
|
||||||
Use: "upload",
|
Use: "upload",
|
||||||
Short: "Upload configuration about the current state, so that 'kubeadm upgrade' can later know how to configure the upgraded cluster.",
|
Short: "Upload configuration about the current state, so that 'kubeadm upgrade' can later know how to configure the upgraded cluster",
|
||||||
RunE: cmdutil.SubCmdRunE("upload"),
|
RunE: cmdutil.SubCmdRunE("upload"),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -280,7 +280,7 @@ func NewCmdConfigUpload(out io.Writer, kubeConfigFile *string) *cobra.Command {
|
||||||
func NewCmdConfigView(out io.Writer, kubeConfigFile *string) *cobra.Command {
|
func NewCmdConfigView(out io.Writer, kubeConfigFile *string) *cobra.Command {
|
||||||
return &cobra.Command{
|
return &cobra.Command{
|
||||||
Use: "view",
|
Use: "view",
|
||||||
Short: "View the kubeadm configuration stored inside the cluster.",
|
Short: "View the kubeadm configuration stored inside the cluster",
|
||||||
Long: fmt.Sprintf(dedent.Dedent(`
|
Long: fmt.Sprintf(dedent.Dedent(`
|
||||||
Using this command, you can view the ConfigMap in the cluster where the configuration for kubeadm is located.
|
Using this command, you can view the ConfigMap in the cluster where the configuration for kubeadm is located.
|
||||||
|
|
||||||
|
@ -303,7 +303,7 @@ func NewCmdConfigUploadFromFile(out io.Writer, kubeConfigFile *string) *cobra.Co
|
||||||
var cfgPath string
|
var cfgPath string
|
||||||
cmd := &cobra.Command{
|
cmd := &cobra.Command{
|
||||||
Use: "from-file",
|
Use: "from-file",
|
||||||
Short: "Upload a configuration file to the in-cluster ConfigMap for kubeadm configuration.",
|
Short: "Upload a configuration file to the in-cluster ConfigMap for kubeadm configuration",
|
||||||
Long: fmt.Sprintf(dedent.Dedent(`
|
Long: fmt.Sprintf(dedent.Dedent(`
|
||||||
Using this command, you can upload configuration to the ConfigMap in the cluster using the same config file you gave to 'kubeadm init'.
|
Using this command, you can upload configuration to the ConfigMap in the cluster using the same config file you gave to 'kubeadm init'.
|
||||||
If you initialized your cluster using a v1.7.x or lower kubeadm client and used the --config option, you need to run this command with the
|
If you initialized your cluster using a v1.7.x or lower kubeadm client and used the --config option, you need to run this command with the
|
||||||
|
@ -343,7 +343,7 @@ func NewCmdConfigUploadFromFlags(out io.Writer, kubeConfigFile *string) *cobra.C
|
||||||
|
|
||||||
cmd := &cobra.Command{
|
cmd := &cobra.Command{
|
||||||
Use: "from-flags",
|
Use: "from-flags",
|
||||||
Short: "Create the in-cluster configuration file for the first time from using flags.",
|
Short: "Create the in-cluster configuration file for the first time from using flags",
|
||||||
Long: fmt.Sprintf(dedent.Dedent(`
|
Long: fmt.Sprintf(dedent.Dedent(`
|
||||||
Using this command, you can upload configuration to the ConfigMap in the cluster using the same flags you gave to 'kubeadm init'.
|
Using this command, you can upload configuration to the ConfigMap in the cluster using the same flags you gave to 'kubeadm init'.
|
||||||
If you initialized your cluster using a v1.7.x or lower kubeadm client and set certain flags, you need to run this command with the
|
If you initialized your cluster using a v1.7.x or lower kubeadm client and set certain flags, you need to run this command with the
|
||||||
|
@ -397,7 +397,7 @@ func RunConfigView(out io.Writer, client clientset.Interface) error {
|
||||||
func NewCmdConfigImages(out io.Writer) *cobra.Command {
|
func NewCmdConfigImages(out io.Writer) *cobra.Command {
|
||||||
cmd := &cobra.Command{
|
cmd := &cobra.Command{
|
||||||
Use: "images",
|
Use: "images",
|
||||||
Short: "Interact with container images used by kubeadm.",
|
Short: "Interact with container images used by kubeadm",
|
||||||
RunE: cmdutil.SubCmdRunE("images"),
|
RunE: cmdutil.SubCmdRunE("images"),
|
||||||
}
|
}
|
||||||
cmd.AddCommand(NewCmdConfigImagesList(out, nil))
|
cmd.AddCommand(NewCmdConfigImagesList(out, nil))
|
||||||
|
@ -414,7 +414,7 @@ func NewCmdConfigImagesPull() *cobra.Command {
|
||||||
|
|
||||||
cmd := &cobra.Command{
|
cmd := &cobra.Command{
|
||||||
Use: "pull",
|
Use: "pull",
|
||||||
Short: "Pull images used by kubeadm.",
|
Short: "Pull images used by kubeadm",
|
||||||
Run: func(_ *cobra.Command, _ []string) {
|
Run: func(_ *cobra.Command, _ []string) {
|
||||||
externalcfg.ClusterConfiguration.FeatureGates, err = features.NewFeatureGate(&features.InitFeatureGates, featureGatesString)
|
externalcfg.ClusterConfiguration.FeatureGates, err = features.NewFeatureGate(&features.InitFeatureGates, featureGatesString)
|
||||||
kubeadmutil.CheckErr(err)
|
kubeadmutil.CheckErr(err)
|
||||||
|
@ -472,7 +472,7 @@ func NewCmdConfigImagesList(out io.Writer, mockK8sVersion *string) *cobra.Comman
|
||||||
|
|
||||||
cmd := &cobra.Command{
|
cmd := &cobra.Command{
|
||||||
Use: "list",
|
Use: "list",
|
||||||
Short: "Print a list of images kubeadm will use. The configuration file is used in case any images or image repositories are customized.",
|
Short: "Print a list of images kubeadm will use. The configuration file is used in case any images or image repositories are customized",
|
||||||
Run: func(_ *cobra.Command, _ []string) {
|
Run: func(_ *cobra.Command, _ []string) {
|
||||||
externalcfg.ClusterConfiguration.FeatureGates, err = features.NewFeatureGate(&features.InitFeatureGates, featureGatesString)
|
externalcfg.ClusterConfiguration.FeatureGates, err = features.NewFeatureGate(&features.InitFeatureGates, featureGatesString)
|
||||||
kubeadmutil.CheckErr(err)
|
kubeadmutil.CheckErr(err)
|
||||||
|
|
|
@ -135,7 +135,7 @@ func NewCmdInit(out io.Writer, initOptions *initOptions) *cobra.Command {
|
||||||
|
|
||||||
cmd := &cobra.Command{
|
cmd := &cobra.Command{
|
||||||
Use: "init",
|
Use: "init",
|
||||||
Short: "Run this command in order to set up the Kubernetes control plane.",
|
Short: "Run this command in order to set up the Kubernetes control plane",
|
||||||
Run: func(cmd *cobra.Command, args []string) {
|
Run: func(cmd *cobra.Command, args []string) {
|
||||||
c, err := initRunner.InitData(args)
|
c, err := initRunner.InitData(args)
|
||||||
kubeadmutil.CheckErr(err)
|
kubeadmutil.CheckErr(err)
|
||||||
|
|
|
@ -31,12 +31,12 @@ import (
|
||||||
|
|
||||||
var (
|
var (
|
||||||
coreDNSAddonLongDesc = normalizer.LongDesc(`
|
coreDNSAddonLongDesc = normalizer.LongDesc(`
|
||||||
Installs the CoreDNS addon components via the API server.
|
Install the CoreDNS addon components via the API server.
|
||||||
Please note that although the DNS server is deployed, it will not be scheduled until CNI is installed.
|
Please note that although the DNS server is deployed, it will not be scheduled until CNI is installed.
|
||||||
`)
|
`)
|
||||||
|
|
||||||
kubeProxyAddonLongDesc = normalizer.LongDesc(`
|
kubeProxyAddonLongDesc = normalizer.LongDesc(`
|
||||||
Installs the kube-proxy addon components via the API server.
|
Install the kube-proxy addon components via the API server.
|
||||||
`)
|
`)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -44,25 +44,25 @@ var (
|
||||||
func NewAddonPhase() workflow.Phase {
|
func NewAddonPhase() workflow.Phase {
|
||||||
return workflow.Phase{
|
return workflow.Phase{
|
||||||
Name: "addon",
|
Name: "addon",
|
||||||
Short: "Installs required addons for passing Conformance tests",
|
Short: "Install required addons for passing Conformance tests",
|
||||||
Long: cmdutil.MacroCommandLongDescription,
|
Long: cmdutil.MacroCommandLongDescription,
|
||||||
Phases: []workflow.Phase{
|
Phases: []workflow.Phase{
|
||||||
{
|
{
|
||||||
Name: "all",
|
Name: "all",
|
||||||
Short: "Installs all the addons",
|
Short: "Install all the addons",
|
||||||
InheritFlags: getAddonPhaseFlags("all"),
|
InheritFlags: getAddonPhaseFlags("all"),
|
||||||
RunAllSiblings: true,
|
RunAllSiblings: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
Name: "coredns",
|
Name: "coredns",
|
||||||
Short: "Installs the CoreDNS addon to a Kubernetes cluster",
|
Short: "Install the CoreDNS addon to a Kubernetes cluster",
|
||||||
Long: coreDNSAddonLongDesc,
|
Long: coreDNSAddonLongDesc,
|
||||||
InheritFlags: getAddonPhaseFlags("coredns"),
|
InheritFlags: getAddonPhaseFlags("coredns"),
|
||||||
Run: runCoreDNSAddon,
|
Run: runCoreDNSAddon,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
Name: "kube-proxy",
|
Name: "kube-proxy",
|
||||||
Short: "Installs the kube-proxy addon to a Kubernetes cluster",
|
Short: "Install the kube-proxy addon to a Kubernetes cluster",
|
||||||
Long: kubeProxyAddonLongDesc,
|
Long: kubeProxyAddonLongDesc,
|
||||||
InheritFlags: getAddonPhaseFlags("kube-proxy"),
|
InheritFlags: getAddonPhaseFlags("kube-proxy"),
|
||||||
Run: runKubeProxyAddon,
|
Run: runKubeProxyAddon,
|
||||||
|
|
|
@ -38,7 +38,7 @@ var (
|
||||||
`)
|
`)
|
||||||
|
|
||||||
bootstrapTokenExamples = normalizer.Examples(`
|
bootstrapTokenExamples = normalizer.Examples(`
|
||||||
# Makes all the bootstrap token configurations and creates an initial token, functionally
|
# Make all the bootstrap token configurations and create an initial token, functionally
|
||||||
# equivalent to what generated by kubeadm init.
|
# equivalent to what generated by kubeadm init.
|
||||||
kubeadm init phase bootstrap-token
|
kubeadm init phase bootstrap-token
|
||||||
`)
|
`)
|
||||||
|
|
|
@ -37,13 +37,13 @@ import (
|
||||||
|
|
||||||
var (
|
var (
|
||||||
saKeyLongDesc = fmt.Sprintf(normalizer.LongDesc(`
|
saKeyLongDesc = fmt.Sprintf(normalizer.LongDesc(`
|
||||||
Generates the private key for signing service account tokens along with its public key, and saves them into
|
Generate the private key for signing service account tokens along with its public key, and save them into
|
||||||
%s and %s files.
|
%s and %s files.
|
||||||
If both files already exist, kubeadm skips the generation step and existing files will be used.
|
If both files already exist, kubeadm skips the generation step and existing files will be used.
|
||||||
`+cmdutil.AlphaDisclaimer), kubeadmconstants.ServiceAccountPrivateKeyName, kubeadmconstants.ServiceAccountPublicKeyName)
|
`+cmdutil.AlphaDisclaimer), kubeadmconstants.ServiceAccountPrivateKeyName, kubeadmconstants.ServiceAccountPublicKeyName)
|
||||||
|
|
||||||
genericLongDesc = normalizer.LongDesc(`
|
genericLongDesc = normalizer.LongDesc(`
|
||||||
Generates the %[1]s, and saves them into %[2]s.cert and %[2]s.key files.%[3]s
|
Generate the %[1]s, and save them into %[2]s.cert and %[2]s.key files.%[3]s
|
||||||
|
|
||||||
If both files already exist, kubeadm skips the generation step and existing files will be used.
|
If both files already exist, kubeadm skips the generation step and existing files will be used.
|
||||||
` + cmdutil.AlphaDisclaimer)
|
` + cmdutil.AlphaDisclaimer)
|
||||||
|
@ -79,7 +79,7 @@ func newCertSubPhases() []workflow.Phase {
|
||||||
// All subphase
|
// All subphase
|
||||||
allPhase := workflow.Phase{
|
allPhase := workflow.Phase{
|
||||||
Name: "all",
|
Name: "all",
|
||||||
Short: "Generates all certificates",
|
Short: "Generate all certificates",
|
||||||
InheritFlags: getCertPhaseFlags("all"),
|
InheritFlags: getCertPhaseFlags("all"),
|
||||||
RunAllSiblings: true,
|
RunAllSiblings: true,
|
||||||
}
|
}
|
||||||
|
@ -102,7 +102,7 @@ func newCertSubPhases() []workflow.Phase {
|
||||||
// SA creates the private/public key pair, which doesn't use x509 at all
|
// SA creates the private/public key pair, which doesn't use x509 at all
|
||||||
saPhase := workflow.Phase{
|
saPhase := workflow.Phase{
|
||||||
Name: "sa",
|
Name: "sa",
|
||||||
Short: "Generates a private key for signing service account tokens along with its public key",
|
Short: "Generate a private key for signing service account tokens along with its public key",
|
||||||
Long: saKeyLongDesc,
|
Long: saKeyLongDesc,
|
||||||
Run: runCertsSa,
|
Run: runCertsSa,
|
||||||
InheritFlags: []string{options.CertificatesDir},
|
InheritFlags: []string{options.CertificatesDir},
|
||||||
|
@ -116,7 +116,7 @@ func newCertSubPhases() []workflow.Phase {
|
||||||
func newCertSubPhase(certSpec *certsphase.KubeadmCert, run func(c workflow.RunData) error) workflow.Phase {
|
func newCertSubPhase(certSpec *certsphase.KubeadmCert, run func(c workflow.RunData) error) workflow.Phase {
|
||||||
phase := workflow.Phase{
|
phase := workflow.Phase{
|
||||||
Name: certSpec.Name,
|
Name: certSpec.Name,
|
||||||
Short: fmt.Sprintf("Generates the %s", certSpec.LongName),
|
Short: fmt.Sprintf("Generate the %s", certSpec.LongName),
|
||||||
Long: fmt.Sprintf(
|
Long: fmt.Sprintf(
|
||||||
genericLongDesc,
|
genericLongDesc,
|
||||||
certSpec.LongName,
|
certSpec.LongName,
|
||||||
|
|
|
@ -66,12 +66,12 @@ func getPhaseDescription(component string) string {
|
||||||
func NewControlPlanePhase() workflow.Phase {
|
func NewControlPlanePhase() workflow.Phase {
|
||||||
phase := workflow.Phase{
|
phase := workflow.Phase{
|
||||||
Name: "control-plane",
|
Name: "control-plane",
|
||||||
Short: "Generates all static Pod manifest files necessary to establish the control plane",
|
Short: "Generate all static Pod manifest files necessary to establish the control plane",
|
||||||
Long: cmdutil.MacroCommandLongDescription,
|
Long: cmdutil.MacroCommandLongDescription,
|
||||||
Phases: []workflow.Phase{
|
Phases: []workflow.Phase{
|
||||||
{
|
{
|
||||||
Name: "all",
|
Name: "all",
|
||||||
Short: "Generates all static Pod manifest files",
|
Short: "Generate all static Pod manifest files",
|
||||||
InheritFlags: getControlPlanePhaseFlags("all"),
|
InheritFlags: getControlPlanePhaseFlags("all"),
|
||||||
Example: controlPlaneExample,
|
Example: controlPlaneExample,
|
||||||
RunAllSiblings: true,
|
RunAllSiblings: true,
|
||||||
|
|
|
@ -45,7 +45,7 @@ var (
|
||||||
func NewEtcdPhase() workflow.Phase {
|
func NewEtcdPhase() workflow.Phase {
|
||||||
phase := workflow.Phase{
|
phase := workflow.Phase{
|
||||||
Name: "etcd",
|
Name: "etcd",
|
||||||
Short: "Generates static Pod manifest file for local etcd.",
|
Short: "Generate static Pod manifest file for local etcd",
|
||||||
Long: cmdutil.MacroCommandLongDescription,
|
Long: cmdutil.MacroCommandLongDescription,
|
||||||
Phases: []workflow.Phase{
|
Phases: []workflow.Phase{
|
||||||
newEtcdLocalSubPhase(),
|
newEtcdLocalSubPhase(),
|
||||||
|
@ -57,7 +57,7 @@ func NewEtcdPhase() workflow.Phase {
|
||||||
func newEtcdLocalSubPhase() workflow.Phase {
|
func newEtcdLocalSubPhase() workflow.Phase {
|
||||||
phase := workflow.Phase{
|
phase := workflow.Phase{
|
||||||
Name: "local",
|
Name: "local",
|
||||||
Short: "Generates the static Pod manifest file for a local, single-node local etcd instance.",
|
Short: "Generate the static Pod manifest file for a local, single-node local etcd instance",
|
||||||
Example: etcdLocalExample,
|
Example: etcdLocalExample,
|
||||||
Run: runEtcdPhaseLocal(),
|
Run: runEtcdPhaseLocal(),
|
||||||
InheritFlags: getEtcdPhaseFlags(),
|
InheritFlags: getEtcdPhaseFlags(),
|
||||||
|
|
|
@ -36,27 +36,27 @@ var (
|
||||||
}{
|
}{
|
||||||
kubeadmconstants.AdminKubeConfigFileName: {
|
kubeadmconstants.AdminKubeConfigFileName: {
|
||||||
name: "admin",
|
name: "admin",
|
||||||
short: "Generates a kubeconfig file for the admin to use and for kubeadm itself",
|
short: "Generate a kubeconfig file for the admin to use and for kubeadm itself",
|
||||||
long: "Generates the kubeconfig file for the admin and for kubeadm itself, and saves it to %s file.",
|
long: "Generate the kubeconfig file for the admin and for kubeadm itself, and save it to %s file.",
|
||||||
},
|
},
|
||||||
kubeadmconstants.KubeletKubeConfigFileName: {
|
kubeadmconstants.KubeletKubeConfigFileName: {
|
||||||
name: "kubelet",
|
name: "kubelet",
|
||||||
short: "Generates a kubeconfig file for the kubelet to use *only* for cluster bootstrapping purposes",
|
short: "Generate a kubeconfig file for the kubelet to use *only* for cluster bootstrapping purposes",
|
||||||
long: normalizer.LongDesc(`
|
long: normalizer.LongDesc(`
|
||||||
Generates the kubeconfig file for the kubelet to use and saves it to %s file.
|
Generate the kubeconfig file for the kubelet to use and save it to %s file.
|
||||||
|
|
||||||
Please note that this should *only* be used for cluster bootstrapping purposes. After your control plane is up,
|
Please note that this should *only* be used for cluster bootstrapping purposes. After your control plane is up,
|
||||||
you should request all kubelet credentials from the CSR API.`),
|
you should request all kubelet credentials from the CSR API.`),
|
||||||
},
|
},
|
||||||
kubeadmconstants.ControllerManagerKubeConfigFileName: {
|
kubeadmconstants.ControllerManagerKubeConfigFileName: {
|
||||||
name: "controller-manager",
|
name: "controller-manager",
|
||||||
short: "Generates a kubeconfig file for the controller manager to use",
|
short: "Generate a kubeconfig file for the controller manager to use",
|
||||||
long: "Generates the kubeconfig file for the controller manager to use and saves it to %s file",
|
long: "Generate the kubeconfig file for the controller manager to use and save it to %s file",
|
||||||
},
|
},
|
||||||
kubeadmconstants.SchedulerKubeConfigFileName: {
|
kubeadmconstants.SchedulerKubeConfigFileName: {
|
||||||
name: "scheduler",
|
name: "scheduler",
|
||||||
short: "Generates a kubeconfig file for the scheduler to use",
|
short: "Generate a kubeconfig file for the scheduler to use",
|
||||||
long: "Generates the kubeconfig file for the scheduler to use and saves it to %s file.",
|
long: "Generate the kubeconfig file for the scheduler to use and save it to %s file.",
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
@ -65,12 +65,12 @@ var (
|
||||||
func NewKubeConfigPhase() workflow.Phase {
|
func NewKubeConfigPhase() workflow.Phase {
|
||||||
return workflow.Phase{
|
return workflow.Phase{
|
||||||
Name: "kubeconfig",
|
Name: "kubeconfig",
|
||||||
Short: "Generates all kubeconfig files necessary to establish the control plane and the admin kubeconfig file",
|
Short: "Generate all kubeconfig files necessary to establish the control plane and the admin kubeconfig file",
|
||||||
Long: cmdutil.MacroCommandLongDescription,
|
Long: cmdutil.MacroCommandLongDescription,
|
||||||
Phases: []workflow.Phase{
|
Phases: []workflow.Phase{
|
||||||
{
|
{
|
||||||
Name: "all",
|
Name: "all",
|
||||||
Short: "Generates all kubeconfig files",
|
Short: "Generate all kubeconfig files",
|
||||||
InheritFlags: getKubeConfigPhaseFlags("all"),
|
InheritFlags: getKubeConfigPhaseFlags("all"),
|
||||||
RunAllSiblings: true,
|
RunAllSiblings: true,
|
||||||
},
|
},
|
||||||
|
|
|
@ -36,8 +36,8 @@ var (
|
||||||
func NewKubeletStartPhase() workflow.Phase {
|
func NewKubeletStartPhase() workflow.Phase {
|
||||||
return workflow.Phase{
|
return workflow.Phase{
|
||||||
Name: "kubelet-start",
|
Name: "kubelet-start",
|
||||||
Short: "Writes kubelet settings and (re)starts the kubelet",
|
Short: "Write kubelet settings and (re)start the kubelet",
|
||||||
Long: "Writes a file with KubeletConfiguration and an environment file with node specific kubelet settings, and then (re)starts kubelet.",
|
Long: "Write a file with KubeletConfiguration and an environment file with node specific kubelet settings, and then (re)start kubelet.",
|
||||||
Example: kubeletStartPhaseExample,
|
Example: kubeletStartPhaseExample,
|
||||||
Run: runKubeletStart,
|
Run: runKubeletStart,
|
||||||
InheritFlags: []string{
|
InheritFlags: []string{
|
||||||
|
|
|
@ -36,24 +36,24 @@ import (
|
||||||
|
|
||||||
var (
|
var (
|
||||||
uploadKubeadmConfigLongDesc = fmt.Sprintf(normalizer.LongDesc(`
|
uploadKubeadmConfigLongDesc = fmt.Sprintf(normalizer.LongDesc(`
|
||||||
Uploads the kubeadm ClusterConfiguration to a ConfigMap called %s in the %s namespace.
|
Upload the kubeadm ClusterConfiguration to a ConfigMap called %s in the %s namespace.
|
||||||
This enables correct configuration of system components and a seamless user experience when upgrading.
|
This enables correct configuration of system components and a seamless user experience when upgrading.
|
||||||
|
|
||||||
Alternatively, you can use kubeadm config.
|
Alternatively, you can use kubeadm config.
|
||||||
`), kubeadmconstants.KubeadmConfigConfigMap, metav1.NamespaceSystem)
|
`), kubeadmconstants.KubeadmConfigConfigMap, metav1.NamespaceSystem)
|
||||||
|
|
||||||
uploadKubeadmConfigExample = normalizer.Examples(`
|
uploadKubeadmConfigExample = normalizer.Examples(`
|
||||||
# uploads the configuration of your cluster
|
# upload the configuration of your cluster
|
||||||
kubeadm init phase upload-config --config=myConfig.yaml
|
kubeadm init phase upload-config --config=myConfig.yaml
|
||||||
`)
|
`)
|
||||||
|
|
||||||
uploadKubeletConfigLongDesc = normalizer.LongDesc(`
|
uploadKubeletConfigLongDesc = normalizer.LongDesc(`
|
||||||
Uploads kubelet configuration extracted from the kubeadm InitConfiguration object to a ConfigMap
|
Upload kubelet configuration extracted from the kubeadm InitConfiguration object to a ConfigMap
|
||||||
of the form kubelet-config-1.X in the cluster, where X is the minor version of the current (API Server) Kubernetes version.
|
of the form kubelet-config-1.X in the cluster, where X is the minor version of the current (API Server) Kubernetes version.
|
||||||
`)
|
`)
|
||||||
|
|
||||||
uploadKubeletConfigExample = normalizer.Examples(`
|
uploadKubeletConfigExample = normalizer.Examples(`
|
||||||
# Uploads the kubelet configuration from the kubeadm Config file to a ConfigMap in the cluster.
|
# Upload the kubelet configuration from the kubeadm Config file to a ConfigMap in the cluster.
|
||||||
kubeadm init phase upload-config kubelet --config kubeadm.yaml
|
kubeadm init phase upload-config kubelet --config kubeadm.yaml
|
||||||
`)
|
`)
|
||||||
)
|
)
|
||||||
|
@ -63,18 +63,18 @@ func NewUploadConfigPhase() workflow.Phase {
|
||||||
return workflow.Phase{
|
return workflow.Phase{
|
||||||
Name: "upload-config",
|
Name: "upload-config",
|
||||||
Aliases: []string{"uploadconfig"},
|
Aliases: []string{"uploadconfig"},
|
||||||
Short: "Uploads the kubeadm and kubelet configuration to a ConfigMap",
|
Short: "Upload the kubeadm and kubelet configuration to a ConfigMap",
|
||||||
Long: cmdutil.MacroCommandLongDescription,
|
Long: cmdutil.MacroCommandLongDescription,
|
||||||
Phases: []workflow.Phase{
|
Phases: []workflow.Phase{
|
||||||
{
|
{
|
||||||
Name: "all",
|
Name: "all",
|
||||||
Short: "Uploads all configuration to a config map",
|
Short: "Upload all configuration to a config map",
|
||||||
RunAllSiblings: true,
|
RunAllSiblings: true,
|
||||||
InheritFlags: getUploadConfigPhaseFlags(),
|
InheritFlags: getUploadConfigPhaseFlags(),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
Name: "kubeadm",
|
Name: "kubeadm",
|
||||||
Short: "Uploads the kubeadm ClusterConfiguration to a ConfigMap",
|
Short: "Upload the kubeadm ClusterConfiguration to a ConfigMap",
|
||||||
Long: uploadKubeadmConfigLongDesc,
|
Long: uploadKubeadmConfigLongDesc,
|
||||||
Example: uploadKubeadmConfigExample,
|
Example: uploadKubeadmConfigExample,
|
||||||
Run: runUploadKubeadmConfig,
|
Run: runUploadKubeadmConfig,
|
||||||
|
@ -82,7 +82,7 @@ func NewUploadConfigPhase() workflow.Phase {
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
Name: "kubelet",
|
Name: "kubelet",
|
||||||
Short: "Uploads the kubelet component config to a ConfigMap",
|
Short: "Upload the kubelet component config to a ConfigMap",
|
||||||
Long: uploadKubeletConfigLongDesc,
|
Long: uploadKubeletConfigLongDesc,
|
||||||
Example: uploadKubeletConfigExample,
|
Example: uploadKubeletConfigExample,
|
||||||
Run: runUploadKubeletConfig,
|
Run: runUploadKubeletConfig,
|
||||||
|
|
|
@ -50,12 +50,12 @@ func getControlPlaneJoinPhaseFlags(name string) []string {
|
||||||
func NewControlPlaneJoinPhase() workflow.Phase {
|
func NewControlPlaneJoinPhase() workflow.Phase {
|
||||||
return workflow.Phase{
|
return workflow.Phase{
|
||||||
Name: "control-plane-join",
|
Name: "control-plane-join",
|
||||||
Short: "Joins a machine as a control plane instance",
|
Short: "Join a machine as a control plane instance",
|
||||||
Example: controlPlaneJoinExample,
|
Example: controlPlaneJoinExample,
|
||||||
Phases: []workflow.Phase{
|
Phases: []workflow.Phase{
|
||||||
{
|
{
|
||||||
Name: "all",
|
Name: "all",
|
||||||
Short: "Joins a machine as a control plane instance",
|
Short: "Join a machine as a control plane instance",
|
||||||
InheritFlags: getControlPlaneJoinPhaseFlags("all"),
|
InheritFlags: getControlPlaneJoinPhaseFlags("all"),
|
||||||
RunAllSiblings: true,
|
RunAllSiblings: true,
|
||||||
},
|
},
|
||||||
|
|
|
@ -43,12 +43,12 @@ var controlPlanePrepareExample = normalizer.Examples(`
|
||||||
func NewControlPlanePreparePhase() workflow.Phase {
|
func NewControlPlanePreparePhase() workflow.Phase {
|
||||||
return workflow.Phase{
|
return workflow.Phase{
|
||||||
Name: "control-plane-prepare",
|
Name: "control-plane-prepare",
|
||||||
Short: "Prepares the machine for serving a control plane.",
|
Short: "Prepare the machine for serving a control plane",
|
||||||
Example: controlPlanePrepareExample,
|
Example: controlPlanePrepareExample,
|
||||||
Phases: []workflow.Phase{
|
Phases: []workflow.Phase{
|
||||||
{
|
{
|
||||||
Name: "all [api-server-endpoint]",
|
Name: "all [api-server-endpoint]",
|
||||||
Short: "Prepares the machine for serving a control plane.",
|
Short: "Prepare the machine for serving a control plane",
|
||||||
InheritFlags: getControlPlanePreparePhaseFlags("all"),
|
InheritFlags: getControlPlanePreparePhaseFlags("all"),
|
||||||
RunAllSiblings: true,
|
RunAllSiblings: true,
|
||||||
},
|
},
|
||||||
|
@ -131,7 +131,7 @@ func getControlPlanePreparePhaseFlags(name string) []string {
|
||||||
func newControlPlanePrepareDownloadCertsSubphase() workflow.Phase {
|
func newControlPlanePrepareDownloadCertsSubphase() workflow.Phase {
|
||||||
return workflow.Phase{
|
return workflow.Phase{
|
||||||
Name: "download-certs [api-server-endpoint]",
|
Name: "download-certs [api-server-endpoint]",
|
||||||
Short: fmt.Sprintf("[EXPERIMENTAL] Downloads certificates shared among control-plane nodes from the %s Secret", kubeadmconstants.KubeadmCertsSecret),
|
Short: fmt.Sprintf("[EXPERIMENTAL] Download certificates shared among control-plane nodes from the %s Secret", kubeadmconstants.KubeadmCertsSecret),
|
||||||
Run: runControlPlanePrepareDownloadCertsPhaseLocal,
|
Run: runControlPlanePrepareDownloadCertsPhaseLocal,
|
||||||
InheritFlags: getControlPlanePreparePhaseFlags("download-certs"),
|
InheritFlags: getControlPlanePreparePhaseFlags("download-certs"),
|
||||||
}
|
}
|
||||||
|
@ -140,7 +140,7 @@ func newControlPlanePrepareDownloadCertsSubphase() workflow.Phase {
|
||||||
func newControlPlanePrepareCertsSubphase() workflow.Phase {
|
func newControlPlanePrepareCertsSubphase() workflow.Phase {
|
||||||
return workflow.Phase{
|
return workflow.Phase{
|
||||||
Name: "certs [api-server-endpoint]",
|
Name: "certs [api-server-endpoint]",
|
||||||
Short: "Generates the certificates for the new control plane components",
|
Short: "Generate the certificates for the new control plane components",
|
||||||
Run: runControlPlanePrepareCertsPhaseLocal, //NB. eventually in future we would like to break down this in sub phases for each cert or add the --csr option
|
Run: runControlPlanePrepareCertsPhaseLocal, //NB. eventually in future we would like to break down this in sub phases for each cert or add the --csr option
|
||||||
InheritFlags: getControlPlanePreparePhaseFlags("certs"),
|
InheritFlags: getControlPlanePreparePhaseFlags("certs"),
|
||||||
}
|
}
|
||||||
|
@ -149,7 +149,7 @@ func newControlPlanePrepareCertsSubphase() workflow.Phase {
|
||||||
func newControlPlanePrepareKubeconfigSubphase() workflow.Phase {
|
func newControlPlanePrepareKubeconfigSubphase() workflow.Phase {
|
||||||
return workflow.Phase{
|
return workflow.Phase{
|
||||||
Name: "kubeconfig [api-server-endpoint]",
|
Name: "kubeconfig [api-server-endpoint]",
|
||||||
Short: "Generates the kubeconfig for the new control plane components",
|
Short: "Generate the kubeconfig for the new control plane components",
|
||||||
Run: runControlPlanePrepareKubeconfigPhaseLocal, //NB. eventually in future we would like to break down this in sub phases for each kubeconfig
|
Run: runControlPlanePrepareKubeconfigPhaseLocal, //NB. eventually in future we would like to break down this in sub phases for each kubeconfig
|
||||||
InheritFlags: getControlPlanePreparePhaseFlags("kubeconfig"),
|
InheritFlags: getControlPlanePreparePhaseFlags("kubeconfig"),
|
||||||
}
|
}
|
||||||
|
@ -158,7 +158,7 @@ func newControlPlanePrepareKubeconfigSubphase() workflow.Phase {
|
||||||
func newControlPlanePrepareControlPlaneSubphase() workflow.Phase {
|
func newControlPlanePrepareControlPlaneSubphase() workflow.Phase {
|
||||||
return workflow.Phase{
|
return workflow.Phase{
|
||||||
Name: "control-plane",
|
Name: "control-plane",
|
||||||
Short: "Generates the manifests for the new control plane components",
|
Short: "Generate the manifests for the new control plane components",
|
||||||
Run: runControlPlanePrepareControlPlaneSubphase, //NB. eventually in future we would like to break down this in sub phases for each component
|
Run: runControlPlanePrepareControlPlaneSubphase, //NB. eventually in future we would like to break down this in sub phases for each component
|
||||||
InheritFlags: getControlPlanePreparePhaseFlags("control-plane"),
|
InheritFlags: getControlPlanePreparePhaseFlags("control-plane"),
|
||||||
}
|
}
|
||||||
|
|
|
@ -57,8 +57,8 @@ var (
|
||||||
func NewKubeletStartPhase() workflow.Phase {
|
func NewKubeletStartPhase() workflow.Phase {
|
||||||
return workflow.Phase{
|
return workflow.Phase{
|
||||||
Name: "kubelet-start [api-server-endpoint]",
|
Name: "kubelet-start [api-server-endpoint]",
|
||||||
Short: "Writes kubelet settings, certificates and (re)starts the kubelet",
|
Short: "Write kubelet settings, certificates and (re)start the kubelet",
|
||||||
Long: "Writes a file with KubeletConfiguration and an environment file with node specific kubelet settings, and then (re)starts kubelet.",
|
Long: "Write a file with KubeletConfiguration and an environment file with node specific kubelet settings, and then (re)start kubelet.",
|
||||||
Run: runKubeletStartJoinPhase,
|
Run: runKubeletStartJoinPhase,
|
||||||
InheritFlags: []string{
|
InheritFlags: []string{
|
||||||
options.CfgPath,
|
options.CfgPath,
|
||||||
|
|
|
@ -308,7 +308,7 @@ func (e *Runner) BindToCommand(cmd *cobra.Command) {
|
||||||
// adds the phases subcommand
|
// adds the phases subcommand
|
||||||
phaseCommand := &cobra.Command{
|
phaseCommand := &cobra.Command{
|
||||||
Use: "phase",
|
Use: "phase",
|
||||||
Short: fmt.Sprintf("use this command to invoke single phase of the %s workflow", cmd.Name()),
|
Short: fmt.Sprintf("Use this command to invoke single phase of the %s workflow", cmd.Name()),
|
||||||
}
|
}
|
||||||
|
|
||||||
cmd.AddCommand(phaseCommand)
|
cmd.AddCommand(phaseCommand)
|
||||||
|
|
|
@ -59,7 +59,7 @@ func NewCmdReset(in io.Reader, out io.Writer) *cobra.Command {
|
||||||
|
|
||||||
cmd := &cobra.Command{
|
cmd := &cobra.Command{
|
||||||
Use: "reset",
|
Use: "reset",
|
||||||
Short: "Run this to revert any changes made to this host by 'kubeadm init' or 'kubeadm join'.",
|
Short: "Run this to revert any changes made to this host by 'kubeadm init' or 'kubeadm join'",
|
||||||
Run: func(cmd *cobra.Command, args []string) {
|
Run: func(cmd *cobra.Command, args []string) {
|
||||||
ignorePreflightErrorsSet, err := validation.ValidateIgnorePreflightErrors(ignorePreflightErrors)
|
ignorePreflightErrorsSet, err := validation.ValidateIgnorePreflightErrors(ignorePreflightErrors)
|
||||||
kubeadmutil.CheckErr(err)
|
kubeadmutil.CheckErr(err)
|
||||||
|
|
|
@ -55,7 +55,7 @@ func NewCmdToken(out io.Writer, errW io.Writer) *cobra.Command {
|
||||||
var dryRun bool
|
var dryRun bool
|
||||||
tokenCmd := &cobra.Command{
|
tokenCmd := &cobra.Command{
|
||||||
Use: "token",
|
Use: "token",
|
||||||
Short: "Manage bootstrap tokens.",
|
Short: "Manage bootstrap tokens",
|
||||||
Long: dedent.Dedent(`
|
Long: dedent.Dedent(`
|
||||||
This command manages bootstrap tokens. It is optional and needed only for advanced use cases.
|
This command manages bootstrap tokens. It is optional and needed only for advanced use cases.
|
||||||
|
|
||||||
|
@ -99,7 +99,7 @@ func NewCmdToken(out io.Writer, errW io.Writer) *cobra.Command {
|
||||||
createCmd := &cobra.Command{
|
createCmd := &cobra.Command{
|
||||||
Use: "create [token]",
|
Use: "create [token]",
|
||||||
DisableFlagsInUseLine: true,
|
DisableFlagsInUseLine: true,
|
||||||
Short: "Create bootstrap tokens on the server.",
|
Short: "Create bootstrap tokens on the server",
|
||||||
Long: dedent.Dedent(`
|
Long: dedent.Dedent(`
|
||||||
This command will create a bootstrap token for you.
|
This command will create a bootstrap token for you.
|
||||||
You can specify the usages for this token, the "time to live" and an optional human friendly description.
|
You can specify the usages for this token, the "time to live" and an optional human friendly description.
|
||||||
|
@ -142,7 +142,7 @@ func NewCmdToken(out io.Writer, errW io.Writer) *cobra.Command {
|
||||||
|
|
||||||
listCmd := &cobra.Command{
|
listCmd := &cobra.Command{
|
||||||
Use: "list",
|
Use: "list",
|
||||||
Short: "List bootstrap tokens on the server.",
|
Short: "List bootstrap tokens on the server",
|
||||||
Long: dedent.Dedent(`
|
Long: dedent.Dedent(`
|
||||||
This command will list all bootstrap tokens for you.
|
This command will list all bootstrap tokens for you.
|
||||||
`),
|
`),
|
||||||
|
@ -160,7 +160,7 @@ func NewCmdToken(out io.Writer, errW io.Writer) *cobra.Command {
|
||||||
deleteCmd := &cobra.Command{
|
deleteCmd := &cobra.Command{
|
||||||
Use: "delete [token-value] ...",
|
Use: "delete [token-value] ...",
|
||||||
DisableFlagsInUseLine: true,
|
DisableFlagsInUseLine: true,
|
||||||
Short: "Delete bootstrap tokens on the server.",
|
Short: "Delete bootstrap tokens on the server",
|
||||||
Long: dedent.Dedent(`
|
Long: dedent.Dedent(`
|
||||||
This command will delete a list of bootstrap tokens for you.
|
This command will delete a list of bootstrap tokens for you.
|
||||||
|
|
||||||
|
@ -188,7 +188,7 @@ func NewCmdToken(out io.Writer, errW io.Writer) *cobra.Command {
|
||||||
func NewCmdTokenGenerate(out io.Writer) *cobra.Command {
|
func NewCmdTokenGenerate(out io.Writer) *cobra.Command {
|
||||||
return &cobra.Command{
|
return &cobra.Command{
|
||||||
Use: "generate",
|
Use: "generate",
|
||||||
Short: "Generate and print a bootstrap token, but do not create it on the server.",
|
Short: "Generate and print a bootstrap token, but do not create it on the server",
|
||||||
Long: dedent.Dedent(`
|
Long: dedent.Dedent(`
|
||||||
This command will print out a randomly-generated bootstrap token that can be used with
|
This command will print out a randomly-generated bootstrap token that can be used with
|
||||||
the "init" and "join" commands.
|
the "init" and "join" commands.
|
||||||
|
|
|
@ -73,7 +73,7 @@ func NewCmdApply(apf *applyPlanFlags) *cobra.Command {
|
||||||
cmd := &cobra.Command{
|
cmd := &cobra.Command{
|
||||||
Use: "apply [version]",
|
Use: "apply [version]",
|
||||||
DisableFlagsInUseLine: true,
|
DisableFlagsInUseLine: true,
|
||||||
Short: "Upgrade your Kubernetes cluster to the specified version.",
|
Short: "Upgrade your Kubernetes cluster to the specified version",
|
||||||
Run: func(cmd *cobra.Command, args []string) {
|
Run: func(cmd *cobra.Command, args []string) {
|
||||||
userVersion, err := getK8sVersionFromUserInput(flags.applyPlanFlags, args, true)
|
userVersion, err := getK8sVersionFromUserInput(flags.applyPlanFlags, args, true)
|
||||||
kubeadmutil.CheckErr(err)
|
kubeadmutil.CheckErr(err)
|
||||||
|
|
|
@ -40,17 +40,17 @@ import (
|
||||||
|
|
||||||
var (
|
var (
|
||||||
upgradeNodeConfigLongDesc = normalizer.LongDesc(`
|
upgradeNodeConfigLongDesc = normalizer.LongDesc(`
|
||||||
Downloads the kubelet configuration from a ConfigMap of the form "kubelet-config-1.X" in the cluster,
|
Download the kubelet configuration from a ConfigMap of the form "kubelet-config-1.X" in the cluster,
|
||||||
where X is the minor version of the kubelet. kubeadm uses the --kubelet-version parameter to determine
|
where X is the minor version of the kubelet. kubeadm uses the --kubelet-version parameter to determine
|
||||||
what the _desired_ kubelet version is. Give
|
what the _desired_ kubelet version is. Give
|
||||||
`)
|
`)
|
||||||
|
|
||||||
upgradeNodeConfigExample = normalizer.Examples(fmt.Sprintf(`
|
upgradeNodeConfigExample = normalizer.Examples(fmt.Sprintf(`
|
||||||
# Downloads the kubelet configuration from the ConfigMap in the cluster. Uses a specific desired kubelet version.
|
# Download the kubelet configuration from the ConfigMap in the cluster. Use a specific desired kubelet version.
|
||||||
kubeadm upgrade node config --kubelet-version %s
|
kubeadm upgrade node config --kubelet-version %s
|
||||||
|
|
||||||
# Simulates the downloading of the kubelet configuration from the ConfigMap in the cluster with a specific desired
|
# Simulate the downloading of the kubelet configuration from the ConfigMap in the cluster with a specific desired
|
||||||
# version. Does not change any state locally on the node.
|
# version. Do not change any state locally on the node.
|
||||||
kubeadm upgrade node config --kubelet-version %[1]s --dry-run
|
kubeadm upgrade node config --kubelet-version %[1]s --dry-run
|
||||||
`, constants.CurrentKubernetesVersion))
|
`, constants.CurrentKubernetesVersion))
|
||||||
)
|
)
|
||||||
|
@ -73,7 +73,7 @@ type controlplaneUpgradeFlags struct {
|
||||||
func NewCmdNode() *cobra.Command {
|
func NewCmdNode() *cobra.Command {
|
||||||
cmd := &cobra.Command{
|
cmd := &cobra.Command{
|
||||||
Use: "node",
|
Use: "node",
|
||||||
Short: "Upgrade commands for a node in the cluster. Currently only supports upgrading the configuration, not the kubelet itself.",
|
Short: "Upgrade commands for a node in the cluster. Currently only support upgrading the configuration, not the kubelet itself",
|
||||||
RunE: cmdutil.SubCmdRunE("node"),
|
RunE: cmdutil.SubCmdRunE("node"),
|
||||||
}
|
}
|
||||||
cmd.AddCommand(NewCmdUpgradeNodeConfig())
|
cmd.AddCommand(NewCmdUpgradeNodeConfig())
|
||||||
|
@ -92,7 +92,7 @@ func NewCmdUpgradeNodeConfig() *cobra.Command {
|
||||||
|
|
||||||
cmd := &cobra.Command{
|
cmd := &cobra.Command{
|
||||||
Use: "config",
|
Use: "config",
|
||||||
Short: "Downloads the kubelet configuration from the cluster ConfigMap kubelet-config-1.X, where X is the minor version of the kubelet.",
|
Short: "Download the kubelet configuration from the cluster ConfigMap kubelet-config-1.X, where X is the minor version of the kubelet",
|
||||||
Long: upgradeNodeConfigLongDesc,
|
Long: upgradeNodeConfigLongDesc,
|
||||||
Example: upgradeNodeConfigExample,
|
Example: upgradeNodeConfigExample,
|
||||||
Run: func(cmd *cobra.Command, args []string) {
|
Run: func(cmd *cobra.Command, args []string) {
|
||||||
|
@ -119,7 +119,7 @@ func NewCmdUpgradeControlPlane() *cobra.Command {
|
||||||
|
|
||||||
cmd := &cobra.Command{
|
cmd := &cobra.Command{
|
||||||
Use: "experimental-control-plane",
|
Use: "experimental-control-plane",
|
||||||
Short: "Upgrades the control plane instance deployed on this node. IMPORTANT. This command should be executed after executing `kubeadm upgrade apply` on another control plane instance",
|
Short: "Upgrade the control plane instance deployed on this node. IMPORTANT. This command should be executed after executing `kubeadm upgrade apply` on another control plane instance",
|
||||||
Long: upgradeNodeConfigLongDesc,
|
Long: upgradeNodeConfigLongDesc,
|
||||||
Example: upgradeNodeConfigExample,
|
Example: upgradeNodeConfigExample,
|
||||||
Run: func(cmd *cobra.Command, args []string) {
|
Run: func(cmd *cobra.Command, args []string) {
|
||||||
|
|
|
@ -46,7 +46,7 @@ func NewCmdPlan(apf *applyPlanFlags) *cobra.Command {
|
||||||
|
|
||||||
cmd := &cobra.Command{
|
cmd := &cobra.Command{
|
||||||
Use: "plan [version] [flags]",
|
Use: "plan [version] [flags]",
|
||||||
Short: "Check which versions are available to upgrade to and validate whether your current cluster is upgradeable. To skip the internet check, pass in the optional [version] parameter.",
|
Short: "Check which versions are available to upgrade to and validate whether your current cluster is upgradeable. To skip the internet check, pass in the optional [version] parameter",
|
||||||
Run: func(_ *cobra.Command, args []string) {
|
Run: func(_ *cobra.Command, args []string) {
|
||||||
userVersion, err := getK8sVersionFromUserInput(flags.applyPlanFlags, args, false)
|
userVersion, err := getK8sVersionFromUserInput(flags.applyPlanFlags, args, false)
|
||||||
kubeadmutil.CheckErr(err)
|
kubeadmutil.CheckErr(err)
|
||||||
|
|
|
@ -53,7 +53,7 @@ func NewCmdUpgrade(out io.Writer) *cobra.Command {
|
||||||
|
|
||||||
cmd := &cobra.Command{
|
cmd := &cobra.Command{
|
||||||
Use: "upgrade",
|
Use: "upgrade",
|
||||||
Short: "Upgrade your cluster smoothly to a newer version with this command.",
|
Short: "Upgrade your cluster smoothly to a newer version with this command",
|
||||||
RunE: cmdutil.SubCmdRunE("upgrade"),
|
RunE: cmdutil.SubCmdRunE("upgrade"),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue