0% found this document useful (0 votes)
103 views1 page

How To Add Node To Rancher Cluster

To add a node to a Rancher Kubernetes cluster: 1. Deploy a VM using the Kubernetes Rancher template, install Docker and configure SSH keys to allow access. 2. Disable swap, enable port forwarding and IP forwarding on the kernel, and add the host to the cluster configuration file. 3. Run 'rke up --update-only' to update the cluster configuration and wait several minutes for the node to join the cluster, which can then be verified with 'kubectl get nodes'.

Uploaded by

Crypto Asyhari
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
103 views1 page

How To Add Node To Rancher Cluster

To add a node to a Rancher Kubernetes cluster: 1. Deploy a VM using the Kubernetes Rancher template, install Docker and configure SSH keys to allow access. 2. Disable swap, enable port forwarding and IP forwarding on the kernel, and add the host to the cluster configuration file. 3. Run 'rke up --update-only' to update the cluster configuration and wait several minutes for the node to join the cluster, which can then be verified with 'kubectl get nodes'.

Uploaded by

Crypto Asyhari
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

How to add node to rancher cluster

1. deploy vm using template kubernetes rancher


2. setting ip, hostname, install docker engine and also add user to docker group
$ curl https://releases.rancher.com/install-docker/19.03.sh | sudo bash -
$ sudo systemctl enable --now docker
$ sudo docker version --format '{{.Server.Version}}'
$ sudo usermod -aG docker rke
3. copy pub key ssh from master01 to new host
$ ssh-copy-id rke@newhost
$ cat $HOME/.ssh/id_rsa.pub | ssh hostname "sudo tee -a
/home/rke/.ssh/authorized_keys"
$ ssh -i $HOME/.ssh/id_rsa rke@hostname docker version
4. disable swap on filesystem
$ sudo sed -i '/ swap / s/^\(.*\)$/#\1/g' /etc/fstab
$ sudo swapoff -a
5. tuning kernel
$ sudo tee -a /etc/sysctl.d/99-kubernetes.conf <<EOF
net.bridge.bridge-nf-call-iptables = 1
net.ipv4.ip_forward = 1
net.bridge.bridge-nf-call-ip6tables = 1
EOF

$ sudo sysctl --system


6. Allow tcp forwarding for new host
$ sudo vi /etc/ssh/sshd_config
AllowTcpForwarding yes
$ sudo systemctl restart ssh

7. add new host on script cluster.yml master01


8. update config
$ rke up --update-only
9. after update config/cluster success, wait 5-10 minnutes and check node are join
to cluster
$ kubectl get nodes

You might also like