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,24 +39,24 @@ import (
var (
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.
` + cmdutil.AlphaDisclaimer)
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.
kubeadm alpha phase selfhosting from-staticpods
`)
kubednsAddonsLongDesc = normalizer.LongDesc(`
Installs the kube-dns addon components via the API server.
corednsAddonsLongDesc = normalizer.LongDesc(`
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.
` + cmdutil.AlphaDisclaimer)
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)
)
@ -116,9 +116,9 @@ func getAddonsSubCommands() []*cobra.Command {
cmdFunc: EnsureAllAddons,
},
{
use: "kube-dns",
short: "Installs the kube-dns addon to a Kubernetes cluster",
long: kubednsAddonsLongDesc,
use: "coredns",
short: "Installs the CoreDNS addon to a Kubernetes cluster",
long: corednsAddonsLongDesc,
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`)
}
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.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."+

View File

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

View File

@ -9,7 +9,7 @@ docs/admin/kubeadm_alpha.md
docs/admin/kubeadm_alpha_phase.md
docs/admin/kubeadm_alpha_phase_addon.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_bootstrap-token.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-scheduler.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.1
docs/man/man1/kubeadm-alpha-phase-bootstrap-token-all.1