Welcome to the Linux Foundation Forum!

Lab 4.1 - kubeadm ugrade plan error

Hi,
When running #7 in Lab 4.1 under "Upgrade the Cluster"
sudo kubeadm upgrade plan

Which results in the error:

[upgrade/config] Next steps:
- OPTION 1: Run 'kubeadm config upload from-flags' and specify the same CLI arguments you passed to 'kubeadm init' when you created your control-plane.
- OPTION 2: Run 'kubeadm config upload from-file' and specify the same config file you passed to 'kubeadm init' when you created your control-plane.
- OPTION 3: Pass a config file to 'kubeadm upgrade' using the --config flag.

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

I had a feeling an error was coming when I ran this command under section 7 of "Backup ETCD Database" same lab.

sudo cp /root/kubeadm-config.yaml $HOME/backup/ and it tells me no such file or directory.

I followed instructions building the cluster, and had no other errors up until this point. I'm trying to view my command line history but I think it may have overwritten my earliest commands.

I think this was what I ran to build the cluster,
kubeadm init --config=kubeadm-config.yaml --upload=certs
There is a kubeadm-config.yaml I found in /home/pch/manifest/kubeadm-config.yaml

Needless to say I've tried Options 1, 2,3 in the error output, passing the kubeadm-config.yaml to kubeadm upgrade but just more errors.

Comments

  • chrispokorni
    chrispokorni Posts: 2,372

    Hi @PeterCharuza,

    Both errors are cased by the kubeadm-config.yaml file missing from the root directory.

    Regards,
    -Chris

  • Hi @chrispokorni
    I tried to move the file from the location I had it saved to /root, but still didn't make a difference.

    Here are the contents of the file:

    pch@master:~$ cat /home/pch/manifest/kubeadm-config.yaml
    apiVersion: kubeadm.k8s.io/v1beta2
    kind: ClusterConfiguration
    kubernetesVersion: 1.20.1
    controlPlaneEndpoint: "master:6443"
    networking:
    podSubnet: 10.0.0.0/16

  • Another potentially telling output?

    pch@master:~$ kubectl -n kube-system get cm kubeadm-config -o yaml
    Error from server (NotFound): configmaps "kubeadm-config" not found
    

    I'm trying to see if there is way to create this configmap now, hopefully allowing the cluster to upgrade.

  • chrispokorni
    chrispokorni Posts: 2,372

    Hi @PeterCharuza,

    Exploring the file /root/kubeadm-init.out may help to find out how the cluster was bootstrapped (assuming it was generated if the steps from the lab guide have been followed).

    Your kubeadm-config.yaml seems to be dated. I would recommend taking a look at the updated course content. Also, the value of the controlPlaneEndpoint was intended to be an alias, not an actual hostname.

    With your kubeadm-config.yaml found in an unexpected directory, it seems that the installation steps have not been followed as presented, leading to possible cluster misconfiguration. Please read carefully and follow the installation steps as they are presented in the lab guide - from the very beginning of Lab Exercise 3.1.

    Regards,
    -Chris

  • Hi @chrispokorni Thanks for that, I did compare my command line history to the Lab 3.1 guide I have in PDF form, and it seemed to match but good call could be out of date.

    That said more likely a mistake on my part :smile: I will check out 3.1 again. Thanks for the support and info!

Categories

Upcoming Training