DEV Community

Leon Nunes
Leon Nunes

Posted on

Kubernetes - Worker nodes

Kubernetes is a container Orchestrator, the main key point of Kubernetes is it packs a lot of things like scheduling, fail-over, high availability all in one tool.

But how does Kubernetes provide all this, well the way it does it is by Clustering multiple servers called as nodes. So basically imagine Kubernetes is a Octopus(But this octopus can start adding tentacles when needed). The nodes are like bee's and Kubernetes is the hive leader.

When you run your containers, the kubernetes scheduler will schedule the pods on the respective node, depending on how many containers are running on those nodes and the amount of space etc it's smart.

So how do I add nodes?

Well the token needs to be added on the nodes, for example K3s uses This

For microk8s use, official docs

microk8s add-node

This will return some joining instructions which should be executed on the MicroK8s instance that you wish to join to the cluster (NOT THE NODE YOU RAN add-node FROM)

From the node you wish to join to this cluster, run the following:
microk8s join

Use the '--worker' flag to join a node as a worker not running the control plane, eg:
microk8s join --worker

If the node you are adding is not reachable through the default interface you can use one of the following:
microk8s join
microk8s join
microk8s join
Enter fullscreen mode Exit fullscreen mode

For kind, Official Docs
To configure kind cluster creation, you will need to create a YAML config file. This file follows Kubernetes conventions for versioning etc.

kind: Cluster
# One control plane node and three "workers".
# While these will not add more real compute capacity and
# have limited isolation, this can be useful for testing
# rolling updates etc.
# The API-server and other control plane components will be
# on the control-plane node.
# You probably don't need this unless you are testing Kubernetes itself.
- role: control-plane
- role: worker
- role: worker
- role: worker
Enter fullscreen mode Exit fullscreen mode

To add a node using kubeadm

kubeadm token create --print-join-command
kubeadm join --token 1642s5.ih5q6mdtf0pt9jey --discovery-token-ca-cet-hash sha256:d35bc841bd1ad7fd0223e506c8484bcafe9aa59427535b2709ed4b41201ce81b
Enter fullscreen mode Exit fullscreen mode

Refer: This

That's all, any feedback or criticism is highly appreciated.

You can reach out to me at @mediocreDevops for any discussions or freelance opportunities.

Discussion (0)