Kubeadm join is used to add a new worker node to an existing Kubernetes cluster. It cannot be used to add a node as a master.
To add a new master node to an existing Kubernetes cluster, you need to perform the following steps:
- Install Kubernetes on the new master node
- Initialize the new master node using kubeadm init
- Join the worker nodes to the new master node using kubeadm join
Here are the detailed steps:
- Install Kubernetes on the new master node
- Follow the instructions from the official Kubernetes documentation for installing Kubernetes on your platform.
- Make sure that you use the same version of Kubernetes as the existing cluster.
- Install any necessary dependencies and packages, such as Docker or CRI-O.
- Initialize the new master node using kubeadm init
- Run kubeadm init on the new master node with appropriate options.
- Specify the same Pod network CIDR as the existing cluster.
- Save the join token and the CA certificate hash generated by kubeadm init.
- Join the worker nodes to the new master node using kubeadm join
- Run kubeadm join on each worker node, specifying the join token and the address of the new master node.
- The worker nodes will automatically connect to the new master node and become part of the cluster.
After completing these steps, your Kubernetes cluster will have multiple master nodes, providing high availability and resilience.