DEV Community

Atsushi Suzuki
Atsushi Suzuki

Posted on

Kubernetest (on-prem) master node and worker node associations.

Procedure for reassociating worker nodes with the master node in on-premise Kubernetes after restarting the worker nodes.
++++++++++++++++++++++++++++++++
[Environment]
Ubuntu 20.10
Cluster Version 1.22.2
++++++++++++++++++++++++++++++++

1) Reset the state of kubelet using kubeadm. (on the worker node)

$ kubeadm reset
Enter fullscreen mode Exit fullscreen mode

2) Generate the --discovery-token-ca-cert-hash (on the master node)

$ openssl x509 -pubkey -in /etc/kubernetes/pki/ca.crt | openssl rsa -pubin -outform der 2>/dev/null | openssl dgst -sha256 -hex | sed 's/^.* //'
Enter fullscreen mode Exit fullscreen mode

Paste the output hash into a notepad for later use.

3) Generate a --token (on the master node)

$ kubeadm token create
Enter fullscreen mode Exit fullscreen mode

Copy and paste the output token into a notepad.

4) Reassociate with the master node (on the worker node)

Use the values output in steps 2) and 3).

kubeadm join [Master Node IP]:6443 --token [token created on master node] --discovery-token-ca-cert-hash sha256:[hash value created on master node]
Enter fullscreen mode Exit fullscreen mode

Image of Datadog

The Future of AI, LLMs, and Observability on Google Cloud

Datadog sat down with Google’s Director of AI to discuss the current and future states of AI, ML, and LLMs on Google Cloud. Discover 7 key insights for technical leaders, covering everything from upskilling teams to observability best practices

Learn More

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay