1

I have a Kubernetes cluster created by Kubeadm.

My current version of the cluster is v1.19.2 and trying to upgrade to v1.20.15-0

Now I am trying to upgrade the kubeadm cluster via kubeadm upgrade plan but I got below error :

[upgrade/config] FATAL: the ConfigMap "kubeadm-config" in the kube-system namespace used for getting configuration information was not found 

But when I check the config map kubeadm-config in the kube-system namespace. it's seem there.

 [root@AWL-MV-IBO-DEV ~]# kubectl get configmap kubeadm-config -n kube-system -o yaml
apiVersion: v1
data:
  ClusterConfiguration: |
    apiServer:
      extraArgs:
        authorization-mode: Node,RBAC
      timeoutForControlPlane: 4m0s
    apiVersion: kubeadm.k8s.io/v1beta2
    certificatesDir: /etc/kubernetes/pki
    clusterName: kubernetes
    controllerManager: {}
    dns:
      type: CoreDNS
    etcd:
      local:
        dataDir: /var/lib/etcd
    imageRepository: k8s.gcr.io
    kind: ClusterConfiguration
    kubernetesVersion: v1.19.2
    networking:
      dnsDomain: cluster.local
      podSubnet: 192.168.0.0/16
      serviceSubnet: 10.96.0.0/12
    scheduler: {}
  ClusterStatus: |
    apiEndpoints:
      awl-mv-ibo-dev:
        advertiseAddress: 10.20.20.214
        bindPort: 6443
    apiVersion: kubeadm.k8s.io/v1beta2
    kind: ClusterStatus
kind: ConfigMap
metadata:
  creationTimestamp: "2020-10-06T13:09:22Z"
  managedFields:
  - apiVersion: v1
    fieldsType: FieldsV1
    fieldsV1:
      f:data:
        .: {}
        f:ClusterConfiguration: {}
        f:ClusterStatus: {}
    manager: kubeadm
    operation: Update
    time: "2020-10-06T13:09:22Z"
  name: kubeadm-config
  namespace: kube-system
  resourceVersion: "162"
  selfLink: /api/v1/namespaces/kube-system/configmaps/kubeadm-config
  uid: a6856541-6e6b-4c7e-9163-05778ef5e1aa

Anyone can advise why it cannot find the config map?

1 Answers1

0

It's a bug, according to this thread in github.

A bug was discovered in the enforceRequirements func for upgrade plan. If a command line argument that specifies the target Kubernetes version is supplied, the returned ClusterConfiguration by enforceRequirements will have its KubernetesVersion field set to the new version.

If no version was specified, the returned KubernetesVersion points to the currently installed one.

The only option is to make enforceRequirements consistent in the upgrade plan case and always return the currently installed version in the KubernetesVersion field.

More information about this fix in this thread.

  • So what is the workaround to upgrade the kubeadm cluster? passing the version as argument also doesn't work –  Jul 07 '22 at 03:21
  • @MuhaiminAiman [As a best practice](https://stackoverflow.com/help/someone-answers), that's a different inquiry that requires you to post a new question in Stack Overflow. Ismael already stated it's a known bug. – Hector Martinez Rodriguez Jul 07 '22 at 23:07