kubeadm - default CoreDNS FeatureGate to true#63509
kubeadm - default CoreDNS FeatureGate to true#63509k8s-github-robot merged 2 commits intokubernetes:masterfrom
Conversation
|
/assign @timothysc |
|
/cc @kubernetes/sig-cluster-lifecycle-pr-reviews |
|
/test pull-kubernetes-e2e-kops-aws |
|
/retest |
cmd/kubeadm/app/features/features.go
Outdated
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
@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 :)
There was a problem hiding this comment.
This is super weird... Why wouldn't we populate the struct from the flag itself?
Is this an artifact of feature-gate mimicking.
There was a problem hiding this comment.
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
cmd/kubeadm/app/features/features.go
Outdated
There was a problem hiding this comment.
+1 seems like the better solution compared to the extra loop to verify Default: true FGs.
cmd/kubeadm/app/cmd/upgrade/plan.go
Outdated
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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)
}There was a problem hiding this comment.
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?
There was a problem hiding this comment.
@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?
There was a problem hiding this comment.
@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.
There was a problem hiding this comment.
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. 👍
There was a problem hiding this comment.
There was a problem hiding this comment.
Put a // TODO: comment with the notes above this and link to a separate issue please.
|
|
timothysc
left a comment
There was a problem hiding this comment.
/approve
Please add the comment listed above then lgtm.
cmd/kubeadm/app/cmd/upgrade/plan.go
Outdated
There was a problem hiding this comment.
Put a // TODO: comment with the notes above this and link to a separate issue please.
There was a problem hiding this comment.
So long as we always used this label even for previous CoreDNS deploys, this is ok.
There was a problem hiding this comment.
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.
5eb74ae to
6e4c0e4
Compare
|
/retest |
|
rebased to resolve merge conflict |
|
/test pull-kubernetes-kubemark-e2e-gce |
|
rebased to resolve merge conflict |
|
/lgtm |
|
[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 DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
/test all [submit-queue is verifying that this PR is safe to merge] |
|
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. |
|
@detiber: The following test failed, say
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. DetailsInstructions 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. |
|
hi, the docs mention: https://kubernetes.io/docs/tasks/administer-cluster/coredns/#installing-coredns-with-kubeadm is this process modified? should the docs be updated for the above? |
I think what's there is still true. |
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:
Currently, this does not effect upgrades. Also, documentation updates will need to be coordinated with this change.