kubeadm: rename the kube-dns phases addon

The command `kubeadm alpha phases addon` has a property
called `kube-dns` which would install kube-dns, pre 1.11.

In the case of 1.11 this property will install CoreDNS,
because the property is also bound to the `CoreDNS` feature gate,
which is now `true` by default.

Fix that by renaming the property to `coredns`, updating the Cobra
info and also updating the unit tests.
This commit is contained in:
Lubomir I. Ivanov 2018-05-24 19:48:49 +03:00
parent bebc5c1c4f
commit ebc254c40f
5 changed files with 12 additions and 12 deletions

View File

@ -39,24 +39,24 @@ import (
var ( var (
allAddonsLongDesc = normalizer.LongDesc(` allAddonsLongDesc = normalizer.LongDesc(`
Installs the kube-dns and the kube-proxys addons components via the API server. Installs the CoreDNS and the kube-proxys addons 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.
` + cmdutil.AlphaDisclaimer) ` + cmdutil.AlphaDisclaimer)
allAddonsExample = normalizer.Examples(` allAddonsExample = normalizer.Examples(`
# Installs the kube-dns and the kube-proxys addons components via the API server, # Installs the CoreDNS and the kube-proxys addons components via the API server,
# functionally equivalent to what installed by kubeadm init. # functionally equivalent to what installed by kubeadm init.
kubeadm alpha phase selfhosting from-staticpods kubeadm alpha phase selfhosting from-staticpods
`) `)
kubednsAddonsLongDesc = normalizer.LongDesc(` corednsAddonsLongDesc = normalizer.LongDesc(`
Installs the kube-dns addon components via the API server. Installs 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.
` + cmdutil.AlphaDisclaimer) ` + cmdutil.AlphaDisclaimer)
kubeproxyAddonsLongDesc = normalizer.LongDesc(` kubeproxyAddonsLongDesc = normalizer.LongDesc(`
Installs the kube-proxy addon components via the API server. Installs the kube-proxy addon components via the API server.
` + cmdutil.AlphaDisclaimer) ` + cmdutil.AlphaDisclaimer)
) )
@ -116,9 +116,9 @@ func getAddonsSubCommands() []*cobra.Command {
cmdFunc: EnsureAllAddons, cmdFunc: EnsureAllAddons,
}, },
{ {
use: "kube-dns", use: "coredns",
short: "Installs the kube-dns addon to a Kubernetes cluster", short: "Installs the CoreDNS addon to a Kubernetes cluster",
long: kubednsAddonsLongDesc, long: corednsAddonsLongDesc,
cmdFunc: dnsaddon.EnsureDNSAddon, cmdFunc: dnsaddon.EnsureDNSAddon,
}, },
{ {
@ -151,7 +151,7 @@ func getAddonsSubCommands() []*cobra.Command {
cmd.Flags().StringVar(&cfg.Networking.PodSubnet, "pod-network-cidr", cfg.Networking.PodSubnet, `The range of IP addresses used for the Pod network`) cmd.Flags().StringVar(&cfg.Networking.PodSubnet, "pod-network-cidr", cfg.Networking.PodSubnet, `The range of IP addresses used for the Pod network`)
} }
if properties.use == "all" || properties.use == "kube-dns" { if properties.use == "all" || properties.use == "coredns" {
cmd.Flags().StringVar(&cfg.Networking.DNSDomain, "service-dns-domain", cfg.Networking.DNSDomain, `Alternative domain for services`) cmd.Flags().StringVar(&cfg.Networking.DNSDomain, "service-dns-domain", cfg.Networking.DNSDomain, `Alternative domain for services`)
cmd.Flags().StringVar(&cfg.Networking.ServiceSubnet, "service-cidr", cfg.Networking.ServiceSubnet, `The range of IP address used for service VIPs`) cmd.Flags().StringVar(&cfg.Networking.ServiceSubnet, "service-cidr", cfg.Networking.ServiceSubnet, `The range of IP address used for service VIPs`)
cmd.Flags().StringVar(&featureGatesString, "feature-gates", featureGatesString, "A set of key=value pairs that describe feature gates for various features."+ cmd.Flags().StringVar(&featureGatesString, "feature-gates", featureGatesString, "A set of key=value pairs that describe feature gates for various features."+

View File

@ -56,7 +56,7 @@ func TestAddonsSubCommandsHasFlags(t *testing.T) {
}, },
}, },
{ {
command: "kube-dns", command: "coredns",
additionalFlags: []string{ additionalFlags: []string{
"service-dns-domain", "service-dns-domain",
"service-cidr", "service-cidr",

View File

@ -9,7 +9,7 @@ docs/admin/kubeadm_alpha.md
docs/admin/kubeadm_alpha_phase.md docs/admin/kubeadm_alpha_phase.md
docs/admin/kubeadm_alpha_phase_addon.md docs/admin/kubeadm_alpha_phase_addon.md
docs/admin/kubeadm_alpha_phase_addon_all.md docs/admin/kubeadm_alpha_phase_addon_all.md
docs/admin/kubeadm_alpha_phase_addon_kube-dns.md docs/admin/kubeadm_alpha_phase_addon_coredns.md
docs/admin/kubeadm_alpha_phase_addon_kube-proxy.md docs/admin/kubeadm_alpha_phase_addon_kube-proxy.md
docs/admin/kubeadm_alpha_phase_bootstrap-token.md docs/admin/kubeadm_alpha_phase_bootstrap-token.md
docs/admin/kubeadm_alpha_phase_bootstrap-token_all.md docs/admin/kubeadm_alpha_phase_bootstrap-token_all.md
@ -86,7 +86,7 @@ docs/man/man1/kube-controller-manager.1
docs/man/man1/kube-proxy.1 docs/man/man1/kube-proxy.1
docs/man/man1/kube-scheduler.1 docs/man/man1/kube-scheduler.1
docs/man/man1/kubeadm-alpha-phase-addon-all.1 docs/man/man1/kubeadm-alpha-phase-addon-all.1
docs/man/man1/kubeadm-alpha-phase-addon-kube-dns.1 docs/man/man1/kubeadm-alpha-phase-addon-coredns.1
docs/man/man1/kubeadm-alpha-phase-addon-kube-proxy.1 docs/man/man1/kubeadm-alpha-phase-addon-kube-proxy.1
docs/man/man1/kubeadm-alpha-phase-addon.1 docs/man/man1/kubeadm-alpha-phase-addon.1
docs/man/man1/kubeadm-alpha-phase-bootstrap-token-all.1 docs/man/man1/kubeadm-alpha-phase-bootstrap-token-all.1