<p>I just migrated my cluster from 1.16 to 1.17.5. Now I would like to migrate it to 1.18.2 (last version).</p>

<p>But the first step fails (kubeadm migrate plan).</p>

<p>It seems that my kubeadm-config configmap misses some values but I don't know which one.
I checked the kubeadm-config configmap and the values are OK for the 1.17.5 version.</p>

<p>Any idea ? </p>

<pre><code># kubeadm upgrade plan --v=5
I0507 14:16:12.685214   16010 plan.go:67] [upgrade/plan] verifying health of cluster
I0507 14:16:12.685280   16010 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'
invalid configuration: kind and apiVersion is mandatory information that needs to be specified in all YAML documents
failed to get component configs
k8s.io/kubernetes/cmd/kubeadm/app/util/config.getInitConfigurationFromCluster
        /workspace/anago-v1.18.0-rc.1.21+8be33caaf953ac/src/k8s.io/kubernetes/_output/dockerized/go/src/k8s.io/kubernetes/cmd/kubeadm/app/util/config/cluster.go:104
k8s.io/kubernetes/cmd/kubeadm/app/util/config.FetchInitConfigurationFromCluster
        /workspace/anago-v1.18.0-rc.1.21+8be33caaf953ac/src/k8s.io/kubernetes/_output/dockerized/go/src/k8s.io/kubernetes/cmd/kubeadm/app/util/config/cluster.go:69
k8s.io/kubernetes/cmd/kubeadm/app/cmd/upgrade.enforceRequirements
        /workspace/anago-v1.18.0-rc.1.21+8be33caaf953ac/src/k8s.io/kubernetes/_output/dockerized/go/src/k8s.io/kubernetes/cmd/kubeadm/app/cmd/upgrade/common.go:97
k8s.io/kubernetes/cmd/kubeadm/app/cmd/upgrade.runPlan
        /workspace/anago-v1.18.0-rc.1.21+8be33caaf953ac/src/k8s.io/kubernetes/_output/dockerized/go/src/k8s.io/kubernetes/cmd/kubeadm/app/cmd/upgrade/plan.go:69
k8s.io/kubernetes/cmd/kubeadm/app/cmd/upgrade.NewCmdPlan.func1
        /workspace/anago-v1.18.0-rc.1.21+8be33caaf953ac/src/k8s.io/kubernetes/_output/dockerized/go/src/k8s.io/kubernetes/cmd/kubeadm/app/cmd/upgrade/plan.go:55
k8s.io/kubernetes/vendor/github.com/spf13/cobra.(*Command).execute
        /workspace/anago-v1.18.0-rc.1.21+8be33caaf953ac/src/k8s.io/kubernetes/_output/dockerized/go/src/k8s.io/kubernetes/vendor/github.com/spf13/cobra/command.go:826
k8s.io/kubernetes/vendor/github.com/spf13/cobra.(*Command).ExecuteC
        /workspace/anago-v1.18.0-rc.1.21+8be33caaf953ac/src/k8s.io/kubernetes/_output/dockerized/go/src/k8s.io/kubernetes/vendor/github.com/spf13/cobra/command.go:914
k8s.io/kubernetes/vendor/github.com/spf13/cobra.(*Command).Execute
        /workspace/anago-v1.18.0-rc.1.21+8be33caaf953ac/src/k8s.io/kubernetes/_output/dockerized/go/src/k8s.io/kubernetes/vendor/github.com/spf13/cobra/command.go:864
k8s.io/kubernetes/cmd/kubeadm/app.Run
        /workspace/anago-v1.18.0-rc.1.21+8be33caaf953ac/src/k8s.io/kubernetes/_output/dockerized/go/src/k8s.io/kubernetes/cmd/kubeadm/app/kubeadm.go:50
main.main
        _output/dockerized/go/src/k8s.io/kubernetes/cmd/kubeadm/kubeadm.go:25
runtime.main
        /usr/local/go/src/runtime/proc.go:203
runtime.goexit
        /usr/local/go/src/runtime/asm_amd64.s:1357
[upgrade/config] FATAL
k8s.io/kubernetes/cmd/kubeadm/app/cmd/upgrade.enforceRequirements
        /workspace/anago-v1.18.0-rc.1.21+8be33caaf953ac/src/k8s.io/kubernetes/_output/dockerized/go/src/k8s.io/kubernetes/cmd/kubeadm/app/cmd/upgrade/common.go:112
k8s.io/kubernetes/cmd/kubeadm/app/cmd/upgrade.runPlan
        /workspace/anago-v1.18.0-rc.1.21+8be33caaf953ac/src/k8s.io/kubernetes/_output/dockerized/go/src/k8s.io/kubernetes/cmd/kubeadm/app/cmd/upgrade/plan.go:69
k8s.io/kubernetes/cmd/kubeadm/app/cmd/upgrade.NewCmdPlan.func1
        /workspace/anago-v1.18.0-rc.1.21+8be33caaf953ac/src/k8s.io/kubernetes/_output/dockerized/go/src/k8s.io/kubernetes/cmd/kubeadm/app/cmd/upgrade/plan.go:55
k8s.io/kubernetes/vendor/github.com/spf13/cobra.(*Command).execute
        /workspace/anago-v1.18.0-rc.1.21+8be33caaf953ac/src/k8s.io/kubernetes/_output/dockerized/go/src/k8s.io/kubernetes/vendor/github.com/spf13/cobra/command.go:826
k8s.io/kubernetes/vendor/github.com/spf13/cobra.(*Command).ExecuteC
        /workspace/anago-v1.18.0-rc.1.21+8be33caaf953ac/src/k8s.io/kubernetes/_output/dockerized/go/src/k8s.io/kubernetes/vendor/github.com/spf13/cobra/command.go:914
k8s.io/kubernetes/vendor/github.com/spf13/cobra.(*Command).Execute
        /workspace/anago-v1.18.0-rc.1.21+8be33caaf953ac/src/k8s.io/kubernetes/_output/dockerized/go/src/k8s.io/kubernetes/vendor/github.com/spf13/cobra/command.go:864
k8s.io/kubernetes/cmd/kubeadm/app.Run
        /workspace/anago-v1.18.0-rc.1.21+8be33caaf953ac/src/k8s.io/kubernetes/_output/dockerized/go/src/k8s.io/kubernetes/cmd/kubeadm/app/kubeadm.go:50
main.main
        _output/dockerized/go/src/k8s.io/kubernetes/cmd/kubeadm/kubeadm.go:25
runtime.main
        /usr/local/go/src/runtime/proc.go:203
runtime.goexit
        /usr/local/go/src/runtime/asm_amd64.s:1357
</code></pre>

<p>Content of the kubeadm-config configmap</p>

<pre><code>apiVersion: v1
data:
  ClusterConfiguration: |
    apiServer:
      certSANs:
      - kubernetes
      - kubernetes.default
      - kubernetes.default.svc
      - kubernetes.default.svc.my-cluster
      - 10.0.22.1
      - localhost
      - 127.0.0.1
      - master1.my-cluster
      - master2.my-cluster
      - master3.my-cluster
      - lb-apiserver.kubernetes.local
      - xxx.xxx.xxx.1
      - xxx.xxx.xxx.3
      - xxx.xxx.xxx.2
      extraArgs:
        allow-privileged: "true"
        anonymous-auth: "True"
        apiserver-count: "3"
        authorization-mode: Node,RBAC
        bind-address: 0.0.0.0
        enable-aggregator-routing: "False"
        endpoint-reconciler-type: lease
        insecure-port: "0"
        kubelet-preferred-address-types: InternalDNS,InternalIP,Hostname,ExternalDNS,ExternalIP
        profiling: "False"
        request-timeout: 1m0s
        runtime-config: ""
        service-node-port-range: 30000-32767
        storage-backend: etcd3
      extraVolumes:
      - hostPath: /etc/pki/tls
        mountPath: /etc/pki/tls
        name: etc-pki-tls
        readOnly: true
      - hostPath: /etc/pki/ca-trust
        mountPath: /etc/pki/ca-trust
        name: etc-pki-ca-trust
        readOnly: true
      timeoutForControlPlane: 5m0s
    apiVersion: kubeadm.k8s.io/v1beta2
    certificatesDir: /etc/kubernetes/ssl
    clusterName: my-cluster
    controlPlaneEndpoint: xxx.xxx.xxx.1:6443
    controllerManager:
      extraArgs:
        bind-address: 0.0.0.0
        configure-cloud-routes: "false"
        node-cidr-mask-size: "24"
        node-monitor-grace-period: 40s
        node-monitor-period: 5s
        pod-eviction-timeout: 5m0s
        profiling: "False"
        terminated-pod-gc-threshold: "12500"
    dns:
      imageRepository: docker.io/coredns
      imageTag: 1.6.5
      type: CoreDNS
    etcd:
      external:
        caFile: /etc/ssl/etcd/ssl/ca.pem
        certFile: /etc/ssl/etcd/ssl/node-node1.pem
        endpoints:
        - https://xxx.xxx.xxx.1:2379
        - https://xxx.xxx.xxx.3:2379
        - https://xxx.xxx.xxx.2:2379
        keyFile: /etc/ssl/etcd/ssl/node-node1-key.pem
    imageRepository: gcr.io/google-containers
    kind: ClusterConfiguration
    kubernetesVersion: v1.17.5
    networking:
      dnsDomain: my-cluster
      podSubnet: 10.0.20.0/24
      serviceSubnet: 10.0.22.0/24
    scheduler:
      extraArgs:
        bind-address: 0.0.0.0
  ClusterStatus: |
    apiEndpoints:
      master1.my-cluster:
        advertiseAddress: xxx.xxx.xxx.1
        bindPort: 6443
      master2.my-cluster:
        advertiseAddress: xxx.xxx.xxx.2
        bindPort: 6443
      master3.my-cluster:
        advertiseAddress: xxx.xxx.xxx.3
        bindPort: 6443
    apiVersion: kubeadm.k8s.io/v1beta2
    kind: ClusterStatus
kind: ConfigMap
metadata:
  creationTimestamp: "2019-10-16T00:57:59Z"
  name: kubeadm-config
  namespace: kube-system
  resourceVersion: "57269932"
  selfLink: /api/v1/namespaces/kube-system/configmaps/kubeadm-config
  uid: 84cece40-38f9-4c82-8844-3f8c29089d7d

</code></pre>

sébastien dagnicourt
<p>Finally found the source of the error.
kind and apiVersion were missing in the kubelet-config configmap, not the kubeadm-config one.
Once fullfiled it is OK.
I opened a feature request to put a little bit more debuging info about the config raising this king of error (<a href="https://github.com/kubernetes/kubernetes/issues/91022" rel="nofollow noreferrer">https://github.com/kubernetes/kubernetes/issues/91022</a>).</p>
