New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Retain CoreDNS corefile when migration fails in kubeadm #84523
Conversation
return err | ||
// Errors in Corefile Migration is verified during preflight checks. This part will be executed should a user choose | ||
// to ignore preflight check errors. | ||
klog.V(2).Infof("the Corefile Migration did not occur due to an error: %v. The existing CoreDNS Corefile configuration has been retained.", err) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
probably better to have this as a klog.Warning(
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a user choose
-> a user chose
chose
in past tense here?
@@ -108,7 +108,7 @@ func checkMigration(client clientset.Interface) error { | |||
|
|||
_, err = migration.Migrate(currentInstalledCoreDNSversion, kubeadmconstants.CoreDNSVersion, corefile, false) | |||
if err != nil { | |||
return err | |||
return errors.Errorf("the CoreDNS configuration migration will not occur due to an error: %v", err) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should be errors.Wrap(err, ....)
thanks @rajansandeep /priority important-longterm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: neolit123, rajansandeep The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/hold |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wording tweaks, and spell out possible repercussions of not migrating the coredns config
@@ -108,7 +108,7 @@ func checkMigration(client clientset.Interface) error { | |||
|
|||
_, err = migration.Migrate(currentInstalledCoreDNSversion, kubeadmconstants.CoreDNSVersion, corefile, false) | |||
if err != nil { | |||
return err | |||
return errors.Errorf("the CoreDNS configuration migration will not occur due to an error: %v", err) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return errors.Errorf("the CoreDNS configuration migration will not occur due to an error: %v", err) | |
return errors.Errorf("the CoreDNS configuration will not be migrated, and may be incompatible with the upgraded version of CoreDNS: %v", err) |
return err | ||
// Errors in Corefile Migration is verified during preflight checks. This part will be executed should a user choose | ||
// to ignore preflight check errors. | ||
klog.V(2).Infof("the Corefile Migration did not occur due to an error: %v. The existing CoreDNS Corefile configuration has been retained.", err) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
klog.V(2).Infof("the Corefile Migration did not occur due to an error: %v. The existing CoreDNS Corefile configuration has been retained.", err) | |
klog.V(2).Infof("the CoreDNS Configuration was not migrated: %v. The existing CoreDNS Corefile configuration has been retained.", err) |
IMO, this fix isn't going to solve custom CoreDNS problems alone. It needs to be documented somewhere that users with custom CoreDNS need to use upgrade phases instead, skipping the CoreDNS upgrade, and doing the CoreDNS upgrade manually (and manually migrating CoreDNS config if necessary). Perhaps we could succinctly explain this in the preflight warning... "... clusters with CoreDNS deployments should use upgrade phases to skip CoreDNS upgrade ..." |
adding something like that SGTM, we can do that once phase support for |
94a9972
to
7074f28
Compare
I don't think this change actually does that. |
my mistake, it does not. |
Actually, now i'm thinking it makes more sense retain both the original corefile AND the original coredns deployment when the migration fails for any reason. That changes the preflight warning to something along the lines of: "CoreDNS will not be upgraded: (error)" |
@rajansandeep WDYT about @chrisohaver 's last comment? |
@neolit123 Yes, I'll push out a commit to make the changes @chrisohaver suggested. |
@@ -108,7 +108,7 @@ func checkMigration(client clientset.Interface) error { | |||
|
|||
_, err = migration.Migrate(currentInstalledCoreDNSversion, kubeadmconstants.CoreDNSVersion, corefile, false) | |||
if err != nil { | |||
return errors.Wrap(err, "the CoreDNS configuration will not be migrated, and may be incompatible with the upgraded version of CoreDNS") | |||
return errors.Wrap(err, "CoreDNS will not be upgraded") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should include the error in the message.
Never mind - it's already doing that. didn't notice the "Wrap"
SGTM, thanks for the updates. |
/lgtm |
/retest |
/hold cancel |
…#84523-upstream-release-1.16 Automated cherry pick of #84523: retain corefile when migration fails
What type of PR is this?
/kind bug
What this PR does / why we need it:
Currently, when a user chooses to skip the preflight check of CoreDNS corefile migration, the kubeadm upgrade fails. This fix bypasses the migration step and retains the existing Corefile in case there is a preflight error and the user chooses to skip.
Which issue(s) this PR fixes:
Fixes #84326
Special notes for your reviewer:
Does this PR introduce a user-facing change?:
Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.: