diff --git a/cmd/kubeadm/app/phases/addons/dns/dns.go b/cmd/kubeadm/app/phases/addons/dns/dns.go index 39e8cf9e401..25cf9ca6a41 100644 --- a/cmd/kubeadm/app/phases/addons/dns/dns.go +++ b/cmd/kubeadm/app/phases/addons/dns/dns.go @@ -238,7 +238,12 @@ func createCoreDNSAddon(deploymentBytes, serviceBytes, configBytes []byte, clien } if IsCoreDNSConfigMapMigrationRequired(corefile) { if err := migrateCoreDNSCorefile(client, coreDNSConfigMap, corefile, currentInstalledCoreDNSVersion); err != nil { - return err + // Errors in Corefile Migration is verified during preflight checks. This part will be executed when a user has chosen + // to ignore preflight check errors. + klog.Warningf("the CoreDNS Configuration was not migrated: %v. The existing CoreDNS Corefile configuration has been retained.", err) + if err := apiclient.CreateOrRetainConfigMap(client, coreDNSConfigMap, kubeadmconstants.CoreDNSConfigMap); err != nil { + return err + } } } else { if err := apiclient.CreateOrUpdateConfigMap(client, coreDNSConfigMap); err != nil { diff --git a/cmd/kubeadm/app/phases/upgrade/preflight.go b/cmd/kubeadm/app/phases/upgrade/preflight.go index 0720b06a14f..d0ffe819e3d 100644 --- a/cmd/kubeadm/app/phases/upgrade/preflight.go +++ b/cmd/kubeadm/app/phases/upgrade/preflight.go @@ -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.Wrap(err, "the CoreDNS configuration will not be migrated, and may be incompatible with the upgraded version of CoreDNS") } return nil }