Multi Node Cluster Setup (Kind)— Kubernetes

Always learning
4 min read5 days ago

--

A multi-node cluster is composed of at least one control plane and one worker node. You can use any node as the taskbox to carry out the installation task.

  • Control plane node. The control plane generally hosts the control plane and controls and manages the whole system.
  • Worker node. Worker nodes run the actual applications deployed on them.

buymeacoffee ☕ 👈 Click the link

Multi-cluster Kubernetes can help optimize resource utilization by balancing the workloads among clusters.

Single cluster → setup where there is only one API server.

Multiple API servers exist in the case of → multi-cluster.

Installation of Kind

Refer the document https://kind.sigs.k8s.io/

kind is a tool for running local Kubernetes clusters using Docker container “nodes”.
kind was primarily designed for testing Kubernetes itself, but may be used for local development (or) CI.

On macOS via Homebrew:

brew install kind

Kind version check kind version

Creating a Cluster — 1

Creating a Kubernetes cluster is as simple as kind create cluster.

kind create cluster --image kindest/node:v1.29.4@sha256:3abb816a5b1061fb15c6e9e60856ec40d56b7b52bcea5f5f1350bc6e2320b6f8 --name cka-cluster1

Currently which cluster is running?

kubectl cluster-info --context kind-cka-cluster1

kubectl config set-context It is used to create a new context or modify an existing one in the context-list.
kubectl config use-context It is used for switching to an already existing context.

Kubectl is a command line tool used to run commands against Kubernetes clusters. It does this by authenticating with the Master Node of your cluster and making API calls to do a variety of management actions.

Kubectl installation guide steps 👈

kubectl version --client

Interacting With Your Cluster

After creating a cluster, you can use kubectl to interact with it by using the configuration file generated by kind.

kubectl get nodes

Provides essential information about the nodes in your Kubernetes cluster. When you execute this command, it communicates with the Kubernetes API server, retrieving the necessary information from the cluster’s control plane.

Create a Multi-node clusters

More than two server nodes and where highly available services can be run on any node in the cluster.

kind: Cluster
apiVersion: kind.x-k8s.io/v1alpha4
nodes:
- role: control-plane
- role: worker
- role: worker

Create a new file config.yaml

Creating a Cluster — 2

Creating a Kubernetes cluster is as simple as kind create cluster

kind create cluster --image kindest/node:v1.29.4@sha256:3abb816a5b1061fb15c6e9e60856ec40d56b7b52bcea5f5f1350bc6e2320b6f8 --name cka-cluster2 --config config.yaml
kubectl get nodes

Which cluster its using getting from them

Refer the kubectl cheatsheet

kubectl config get-contexts

Retrieves information about the current Kubernetes context. This command is part of the kubectl utility, which interacts with Kubernetes clusters.

Switch to another cluster

kubectl config use-context kind-cka-cluster1

The default location of the kubeconfig file is ~/. kube/config . There are other ways to specify the kubeconfig location, such as the KUBECONFIG environment variable or the kubectl — kubeconfig parameter.

Install minikube https://ibrahims.medium.com/install-minikube-on-mac-d0fb21f5a09a 👈

Thank you 🙏 for taking the time to read our blog.

--

--

Always learning

கற்றுக் கொள்ளும் மாணவன்...