Skip to content

kubeadm - default CoreDNS FeatureGate to true#63509

Merged
k8s-github-robot merged 2 commits intokubernetes:masterfrom
detiber:CoreDNSDefault
May 15, 2018
Merged

kubeadm - default CoreDNS FeatureGate to true#63509
k8s-github-robot merged 2 commits intokubernetes:masterfrom
detiber:CoreDNSDefault

Conversation

@detiber
Copy link
Copy Markdown
Contributor

@detiber detiber commented May 7, 2018

What this PR does / why we need it:

This PR updates kubeadm to deploy CoreDNS rather than KubeDNS by default for new installs.

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
Addresses part of kubernetes/kubeadm#782

Release note:

kubeadm will now deploy CoreDNS by default instead of KubeDNS

Currently, this does not effect upgrades. Also, documentation updates will need to be coordinated with this change.

@k8s-ci-robot k8s-ci-robot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. area/kubeadm sig/cluster-lifecycle Categorizes an issue or PR as relevant to SIG Cluster Lifecycle. labels May 7, 2018
@detiber
Copy link
Copy Markdown
Contributor Author

detiber commented May 7, 2018

/assign @timothysc
/assign @luxas

@detiber
Copy link
Copy Markdown
Contributor Author

detiber commented May 7, 2018

/cc @kubernetes/sig-cluster-lifecycle-pr-reviews

@detiber
Copy link
Copy Markdown
Contributor Author

detiber commented May 7, 2018

/test pull-kubernetes-e2e-kops-aws

@detiber
Copy link
Copy Markdown
Contributor Author

detiber commented May 8, 2018

/retest

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@detiber

Jason, wouldn't the above append all feature gates that the user didn't specify on the command line and set them to true? say if DynamicKubeletConfig was not set by the user this would override the default from false to true.

please, correct me if i'm wrong.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@neolit123 It will only set the ones that have a default value of true. Without this, updating the default value of the feature has no effect. That said, I'm not a fan of this hack, and will take another look today to see if there is a better way to bubble up the feature default value :)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is super weird... Why wouldn't we populate the struct from the flag itself?

Is this an artifact of feature-gate mimicking.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've changed course on this and found a better fix that also does the proper thing for upgrade. I'm still working on fixing the plan and upgrade tests to handle it properly, though

@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels May 9, 2018
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 seems like the better solution compared to the extra loop to verify Default: true FGs.

Copy link
Copy Markdown
Member

@neolit123 neolit123 May 9, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

given the DNSType extension i would refactor the above to be a switch / case instead of handling it with if / then. it would then need less line changes once more DNS types are introduced.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Latest updates the conditionals that set printKubeDNS/printCoreDNS and the before/after versions, but since we need to potentially print multiples I think it still made sense to leave the if statements in place for the actual printing of the output.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

a map can be used too, but it kind of depends if it's OK to print names in the tabs \t:
this also solves the case where the before and after types differ (?). to my understanding this was possible.

// define names for known DNS types here
var dnsNames = make(map[string]string)
dnsNames[constants.CoreDNS] = "CoreDNS"
dnsNames[constants.KubeDNS] = "KubeDNS"

dnsBefore, isKnownDNSBefore := dnsNames[upgrade.Before.DNSType]
dnsAfter, isKnownDNSAfter := dnsNames[upgrade.After.DNSType]

if isKnownDNSBefore && isKnownDNSAfter {
	fmt.Printf("DNS upgrade\t%s %s\t%s %s\n", dnsBefore, upgrade.Before.DNSVersion, dnsAfter, upgrade.After.DNSVersion)
} else {
	// do we need to print an error?
	fmt.Printf("DNS upgrade encountered unknown type. Before: %s, After: %s\n", upgrade.Before.DNSType, upgrade.After.DNSType)  
}

Copy link
Copy Markdown
Contributor Author

@detiber detiber May 10, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oooh, I like that!

Playing around with this a bit, and I think it might make the output a bit confusing compared to the surrounding context. That said, I think the output from the current state of this PR is a bit confusing as well.

I think it would be worth putting some thought into how to properly handle this from a UX perspective, since there are a few different cases that we need to take into account:

  • component changes, such as Kube DNS to CoreDNS
  • new components added (possibly new default addons that weren't available for the previous version)
  • components removed (if we potentially would ever want to deprecate an addon, or if multiple addons are merged into a single addon)

Ideally, in the case that we are replacing a component we should break it out from the component upgrade output and draw attention to it in a way that makes it clear to the user what is happening.

@neolit123 do you have any objections with continuing that discussion on a separate issue that can be addressed as a followup?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@detiber I'm not sure I got the full problem here, but I think that we should consider also to use mutators to "fix" older configuration in order to adapt to the latest change in code.
In this case, when upgrading, if the fetureflag CoreDNS is not set, we should add fetureflag coreDNS=false in order to avoid an unexpected switch to CoreDNS.
WDYT?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@fabriziopandini If this was just a case of changing a default for a choice of options that were going to be supported long term, then I would agree with trying to use some type of a mutator to persist the existing config. However, since Kube DNS is being phased out, I think a user should be required to opt-in in order to keep using it.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ideally, in the case that we are replacing a component we should break it out from the component upgrade output and draw attention to it in a way that makes it clear to the user what is happening.

@neolit123 do you have any objections with continuing that discussion on a separate issue that can be addressed as a followup?

@detiber sounds good, that would probably be the correct course. 👍

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Put a // TODO: comment with the notes above this and link to a separate issue please.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@timothysc done

@neolit123
Copy link
Copy Markdown
Member

cmd/kubeadm/app/phases/upgrade needs a bazel update.
the e2e-gce failed test seems unrelated (i think).

@k8s-ci-robot k8s-ci-robot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels May 9, 2018
@detiber detiber changed the title [WIP] kubeadm - default CoreDNS FeatureGate to true kubeadm - default CoreDNS FeatureGate to true May 10, 2018
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label May 10, 2018
Copy link
Copy Markdown
Contributor

@timothysc timothysc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/approve

Please add the comment listed above then lgtm.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Put a // TODO: comment with the notes above this and link to a separate issue please.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So long as we always used this label even for previous CoreDNS deploys, this is ok.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, this label has been used consistently within kubeadm and this is also consistent with the use in /cluster for use with the dns pod autoscaler used there.

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label May 14, 2018
@detiber detiber force-pushed the CoreDNSDefault branch 2 times, most recently from 5eb74ae to 6e4c0e4 Compare May 14, 2018 16:18
@detiber
Copy link
Copy Markdown
Contributor Author

detiber commented May 14, 2018

/retest

Copy link
Copy Markdown
Contributor

@timothysc timothysc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm
/approve

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label May 14, 2018
@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label May 15, 2018
@detiber
Copy link
Copy Markdown
Contributor Author

detiber commented May 15, 2018

rebased to resolve merge conflict

@neolit123
Copy link
Copy Markdown
Member

/test pull-kubernetes-kubemark-e2e-gce

@detiber
Copy link
Copy Markdown
Contributor Author

detiber commented May 15, 2018

rebased to resolve merge conflict

@luxas
Copy link
Copy Markdown
Member

luxas commented May 15, 2018

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label May 15, 2018
@k8s-ci-robot
Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: detiber, luxas, timothysc

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-github-robot
Copy link
Copy Markdown

/test all [submit-queue is verifying that this PR is safe to merge]

@k8s-github-robot
Copy link
Copy Markdown

Automatic merge from submit-queue (batch tested with PRs 63658, 63509, 63800, 63586, 63840). If you want to cherry-pick this change to another branch, please follow the instructions here.

@k8s-github-robot k8s-github-robot merged commit 67200c9 into kubernetes:master May 15, 2018
@k8s-ci-robot
Copy link
Copy Markdown
Contributor

k8s-ci-robot commented May 15, 2018

@detiber: The following test failed, say /retest to rerun them all:

Test name Commit Details Rerun command
pull-kubernetes-integration 08ba47b link /test pull-kubernetes-integration

Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

@neolit123
Copy link
Copy Markdown
Member

@detiber

hi, the docs mention:

Note that if you are running CoreDNS in your cluster already, prior to upgrade, your existing Corefile will be
**overwritten** by the one created during upgrade. **You should save your existing ConfigMap
if you have customized it.** You may re-apply your customizations after the new ConfigMap is
up and running.

This process will be modified for the GA release of this feature, such that an existing
Corefile will not be overwritten.

https://kubernetes.io/docs/tasks/administer-cluster/coredns/#installing-coredns-with-kubeadm

is this process modified? should the docs be updated for the above?

@luxas
Copy link
Copy Markdown
Member

luxas commented May 23, 2018

is this process modified? should the docs be updated for the above?

I think what's there is still true.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. area/kubeadm cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. release-note Denotes a PR that will be considered when it comes time to generate release notes. sig/cluster-lifecycle Categorizes an issue or PR as relevant to SIG Cluster Lifecycle. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants