Welcome to the Linux Foundation Forum!

Properly restarting nodes

Hi,
I'm doing my labs using two VirtualBox Ubuntu Servers on local.
It works as expected, but if I have to stop the training and shut down nodes, I cannot figure out how to properly restart them.
I think it would be great to include this part on the training.

I try to do like this:

sudo swapoff -a
sudo kubeadm reset
sudo kubeadm init --kubernetes-version 1.16.1 --pod-network-cidr 192.168.0.0/16

and then, as stated in last command output:

mkdir -p $HOME/.kube
sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
sudo chown $(id -u):$(id -g) $HOME/.kube/config

But in the best scenario I get new credentials so I am not able to relink the worker node...

Could somebody please provide a straight process for this?

Thank you and keep rocking !

David

Best Answers

Answers

  • Hi @chrispokorni ,

    Thank you for your response :smile:
    Problem here is that if I shut down my master machine, when I restart it, the cluster is down. If I restart and execute

    kubectl get nodes

    I get an error (Unable to connect to the server) because kubernetes is down.
    My question is, at this point, how to restart it?
    I expected the server to restart on boot, but it is not doing it (unless I've missed some instruction when installing it)

    Thanks again,

    David

  • chrispokorni
    chrispokorni Posts: 2,366

    Hi David / @dcarrascal75,

    Since you are on VirtualBox, there may be a conflict between the node IP subnet and the Pod IP subnet. Calico uses 192.168.0.0/16 by default, and VBox uses a similar subnet. In such situations, issues may be encountered when rebooting nodes.

    Also, if your master node does not retain the same IP address after reboot, then your kubectl is not able to talk to the master (based on kubeconfig) and the worker cannot find the master either.

    Regards,
    -Chris

  • Hi @chrispokorni , @serewicz,

    I've finally found the issue thanks to journalctl -u kubelet command.
    There was not a problem with IP, but is definitely something to keep in mind when working with VMs.

    Problem was between the keyboard and the chair, as usual :smile:
    I cloned my last master VM from an image where I have not still done the swapoff, so the kubelet is not able to start.

    Thank you for your great help and support.
    Amazing!

    Greetings from Spain,

    David

Categories

Upcoming Training