1

Recently I upgraded Kubernetes cluster from version 1.5.3 to 1.6.1 using kubeadm.

Now I would like to upgrade from version 1.6.1 to 1.6.2 but I'm facing this error:

[root@master ~]#kubeadm upgrade plan --v=5
I1113 14:14:31.046080    8368 plan.go:67] [upgrade/plan] verifying health of cluster
I1113 14:14:31.046233    8368 plan.go:68] [upgrade/plan] retrieving configuration from cluster
[upgrade/config] Making sure the configuration is correct:
[upgrade/config] Reading configuration from the cluster...
[upgrade/config] FYI: You can look at this config file with 'kubectl -n kube-system get cm kubeadm-config -oyaml'
I1113 14:14:31.111668    8368 common.go:122] running preflight checks
[preflight] Running pre-flight checks.
I1113 14:14:31.111843    8368 preflight.go:78] validating if there are any unsupported CoreDNS plugins in the Corefile
I1113 14:14:31.143841    8368 preflight.go:103] validating if migration can be done for the current CoreDNS release.
[preflight] Some fatal errors occurred:
    [ERROR CoreDNSUnsupportedPlugins]: start version '' not supported
    [ERROR CoreDNSMigration]: start version '' not supported
[preflight] If you know what you are doing, you can make a check non-fatal with `--ignore-preflight-errors=...`

It seems that kubeadm is not able to resolve CoreDNS version.

Here is the CoreDNS config:

apiVersion: v1
data:
  Corefile: |
    .:53 {
        errors
        health
        ready
        kubernetes cluster.local in-addr.arpa ip6.arpa {
           pods insecure
           fallthrough in-addr.arpa ip6.arpa
           ttl 30
        }
        prometheus :9153
        forward . /etc/resolv.conf
        cache 30
        loop
        reload
        loadbalance
    }
kind: ConfigMap
metadata:
  creationTimestamp: "2018-12-15T00:02:45Z"
  name: coredns
  namespace: kube-system
  resourceVersion: "45537229"
  selfLink: /api/v1/namespaces/kube-system/configmaps/coredns
  uid: c01fbb58-fffc-11e8-9a01-005056a31666

From where it is reading the version number? Or what can I do to solve this error?

cgrim
  • 121
  • 1
  • 7

2 Answers2

1

You received failed CoreDNSUnsupportedPlugins check due to proxy plugin that has been replaced with forward plugin. Here you can find more information about that.

There are two ways to solve this:

  • One is to ignore checks using
    --ignore-preflight-errors=CoreDNSUnsupportedPlugins at the time of the upgrade.

  • Second one is to replace proxy . /etc/resolv.conf from coredns configMap with forward.It should look like this:

    forward . /etc/resolv.conf

You can find more information about the same problem here

acid_fuji
  • 533
  • 3
  • 8
  • I already use `forward` plugin and not `proxy` as you can see in the CoreDNS config in my question. It is a different issue. Anyway thanks for the response. – cgrim Nov 13 '19 at 16:09
1

Finally I discovered the cause of the problem. The coredns pod was terminated and could not resurect itself.

So I removed the pod by:

kubectl -n kube-system delete pod coredns-79ff88449c-4gjzs --grace-period=0 --force

And then installed it manually using deploy.sh script from https://github.com/coredns/deployment/tree/master/kubernetes like this:

./deploy.sh | kubectl apply -f -

Now kubeadm upgrade works again like a charm.

And it seems that kubeadm reads CoreDNS version from the running pod.

cgrim
  • 121
  • 1
  • 7