Merge pull request #64274 from neolit123/kubeadm-alpha-phase-addon

Automatic merge from submit-queue (batch tested with PRs 64308, 64367, 64165, 64274). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

kubeadm: rename the `kube-dns` phases addon

**What this PR does / why we need it**:
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.

**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
Fixes https://github.com/kubernetes/kubeadm/issues/856

**Special notes for your reviewer**:
Please verify if we are OK with the "hard rename".

**Release note**:

```release-note
kubeadm: rename the addon parameter `kube-dns` to `coredns` for `kubeadm alpha phases addons` as CoreDNS is now the default DNS server in 1.11.
```

@kubernetes/sig-cluster-lifecycle-pr-reviews 
/area kubeadm
This commit is contained in:
Kubernetes Submit Queue 2018-05-28 18:20:14 -07:00 committed by GitHub
commit 046619f3ae
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 12 additions and 12 deletions

View File

@ -39,19 +39,19 @@ 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)
@ -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