Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Adding node to existing cluster in Kubernetes

I have a kubernetes cluster running on 2 machines (master-minion node and minion node). I want to add a new minion node without disrupting the current set up, is there a way to do it?

I have seen that when I try to add the new node, the services on the other nodes stops it, due to which I have to stop the services before deploying the new node to the existing cluster.

like image 561
adyanthaya17 Avatar asked Sep 01 '15 00:09

adyanthaya17


People also ask

How many nodes can run in Kubernetes cluster?

A cluster is a set of nodes (physical or virtual machines) running Kubernetes agents, managed by the control plane. Kubernetes v1. 25 supports clusters with up to 5000 nodes.


2 Answers

To do this in the latest version (tested on 1.10.0) you can issue following command on the masternode:

kubeadm token create --print-join-command

It will then print out a new join command (like the one you got after kubeadmn init):

kubeadm join 192.168.1.101:6443 --token tokentoken.lalalalaqyd3kavez --discovery-token-ca-cert-hash sha256:complexshaoverhere

like image 62
Tom Dierckx Avatar answered Sep 24 '22 12:09

Tom Dierckx


You need to run kubelet and kube-proxy on a new minion indicating api address in params.

Example:

kubelet --api_servers=http://<API_SERVER_IP>:8080 --v=2 --enable_server --allow-privileged kube-proxy --master=http://<API_SERVER_IP>:8080 --v=2 

After this you should see new node in

kubectl get no 
like image 27
Maxim Filatov Avatar answered Sep 23 '22 12:09

Maxim Filatov