How To Add A Node To Kubernetes Cluster
This postal service will show you how to add new worker nodes to existing kubernetes cluster without disturbing running application pods.If you lot are new to kubernetes and want to learn nearly kubernetes from basics, Refer the below links to understand this topic from basics and as well yous can checkout our all tutorial videos on YouTube for free.
What is Kubernetes – Learn Kubernetes from Basics
How to Install Kubernetes on Linux (RedHat / CentOS)
How to Install Kubernetes On Ubuntu 16.04 LTS
How to Create Kubernetes Deployment, Services & Pods Using Kubectl
How to Create Kubernetes YAML for Deployment, Service & Pods
Kubernetes Volumes Explained with Examples
Kubernetes Persistent Volumes and Claims Explained
How to Add New Worker Node to Existing Kubernetes Cluster
Prerequisites to add new worker nodes:
one. A New Node with Minimum 2 CPU'southward with 4Gb Memory is required. Operating organization should be installed and ready for the setup, i used Ubuntu 16.04 LTS – 64 Bit.
2. Make sure kubernetes master and new worker node is reachable between each other.
3. Kubernetes doesn't support "Swap". Then Disable Swap on new node using below command and as well to make it permanent comment out the swap entry in /etc/fstab file.
sudo swapoff -a
iv. Internet must be enabled on new node, because required packages volition be downloaded from official repository.
Get the Joining Token first from Kubernetes Main Node
Log in to Kubernetes Main node and go the joining token as beneath.
user1@kubernetes-master:~$ kubeadm token list
If no join token is available, generate new join token using kubeadm control.
user1@kubernetes-main:~$ kubeadm token create –print-join-command
W0331 13:ten:57.055398 12062 configset.go:202] WARNING: kubeadm cannot validate component configs for API groups [kubelet.config.k8s.io kubeproxy.config.k8s.io]
kubeadm join 192.168.two.i:6443 –token jnnu6g.wqbmmc1l2xtdf40t –discovery-token-ca-cert-hash sha256:ce4c91f6f5442c8c8519cacd4673864f3ce5e466435a6f6ac9e877d1c831f6dc
user1@kubernetes-chief:~$ kubeadm token list
TOKEN TTL EXPIRES USAGES DESCRIPTION EXTRA GROUPS
jnnu6g.wqbmmc1l2xtdf40t 23h 2020-04-01T13:10:57+05:thirty authentication,signing <none> arrangement:bootstrappers:kubeadm:default-node-token
Re-create the token highlighted in yellow colour to bring together the worker nodes and keep information technology bated.
On Worker Nodes, perform the below steps to join the worker nodes.
Update the Ubuntu Repositories and install basic tools similar apt-ship-https, curl.
sudo apt-get update && sudo apt-get install -y apt-transport-https curl
Add together the Kubernetes Signing Key on new worker nodes.
sudo roll -s https://packages.cloud.google.com/apt/doc/apt-central.gpg | sudo apt-key add –
Add kubernetes repository on new worker nodes.
sudo apt-add-repository "deb http://apt.kubernetes.io/ kubernetes-xenial main"
Install the below required packages on new worker nodes using apt-get command.
sudo apt-get update && sudo apt-get install -y kubelet kubeadm kubectl docker.io
Start and Enable the Docker service on new worker nodes.
sudo systemctl enable docker
Use the Joining token you take copied before to add together the worker nodes.
user1@kubernetes-worker3:~$sudo kubeadm join 192.168.2.1:6443 –token jnnu6g.wqbmmc1l2xtdf40t –discovery-token-ca-cert-hashsha256:ce4c91f6f5442c8c8519cacd4673864f3ce5e466435a6f6ac9e877d1c831f6dc
W0331 14:00:32.775291 7193 bring together.go:346] [preflight] WARNING: JoinControlPane.controlPlane settings will be ignored when control-plane flag is not set.
[preflight] Running pre-flight checks
[Warning IsDockerSystemdCheck]: detected "cgroupfs" as the Docker cgroup driver. The recommended driver is "systemd". Delight follow the guide at https://kubernetes.io/docs/setup/cri/
[preflight] Reading configuration from the cluster…
[preflight] FYI: You tin expect at this config file with 'kubectl -n kube-system go cm kubeadm-config -oyaml'
[kubelet-start] Downloading configuration for the kubelet from the "kubelet-config-1.18" ConfigMap in the kube-organisation namespace
[kubelet-starting time] Writing kubelet configuration to file "/var/lib/kubelet/config.yaml"
[kubelet-outset] Writing kubelet environs file with flags to file "/var/lib/kubelet/kubeadm-flags.env"
[kubelet-start] Starting the kubelet
[kubelet-offset] Waiting for the kubelet to perform the TLS Bootstrap…
This node has joined the cluster:
* Certificate signing request was sent to apiserver and a response was received.
* The Kubelet was informed of the new secure connection details.
Run 'kubectl get nodes' on the control-aeroplane to see this node bring together the cluster.
user1@kubernetes-worker3:~$
Our new worker node is joined to the cluster successfully every bit per the above output. Lets login to Kubernetes master and confirm the node listing.
On Kubernetes Master
Verify the list of nodes using kubectl command.
user1@kubernetes-chief:~$ kubectl get nodes
Proper name Condition ROLES AGE VERSION
kubernetes-main Ready principal 71m v1.18.0
kubernetes-worker1 Ready <none> 69m v1.xviii.0
kubernetes-worker2 Ready <none> 69m v1.xviii.0
kubernetes-worker3 Ready <none> 59m v1.18.0
That's it, Above output shows our newly added worker nodes.
Promise you accept got an idea How to Add together New Worker Node to Existing Kubernetes Cluster.
Keep practicing and accept fun. Exit your comments if any.
Also refer below manufactures and checkout all tutorial videos on youtube.
What is Kubernetes – Learn Kubernetes from Basics
How to Install Kubernetes on Linux (RedHat / CentOS)
How to Install Kubernetes On Ubuntu sixteen.04 LTS
How to Create Kubernetes Deployment, Services & Pods Using Kubectl
How to Create Kubernetes YAML for Deployment, Service & Pods
Kubernetes Volumes Explained with Examples
Kubernetes Persistent Volumes and Claims Explained
Proceed practicing and have fun. Go out your comments if whatsoever.
Support United states of america: Share with your friends and groups.
Stay connected with us on social networking sites, Thank you.
How To Add A Node To Kubernetes Cluster,
Source: https://www.learnitguide.net/2020/03/add-new-worker-node-kubernetes-cluster.html
Posted by: scottuporthe.blogspot.com
0 Response to "How To Add A Node To Kubernetes Cluster"
Post a Comment