What is KIND and how to setup multi-node cluster in Kubernetes using KIND

KIND (Kubernetes IN Docker) is a tool that allows you to run Kubernetes single or multi node clusters in Docker containers. It's mainly used for:

  • Local Kubernetes development and testing.
  • CI/CD pipelines.
  • Running Kubernetes clusters in isolated environments without requiring a cloud provider or complex setup.


Step-by-Step Installation Guide on Ubuntu:

1. Use Step 1-8 to install docker using following link.

2. Install kubectl
    sudo snap install kubectl --classic

3. Install KIND.
    curl -Lo ./kind "https://kind.sigs.k8s.io/dl/latest/kind-linux-amd64"
    chmod +x ./kind
    sudo mv ./kind /usr/local/bin/kind

4. Create a Multi-Node Cluster: For a multi-node setup, create a configuration file:-
    a. create and save file  kindmultinode.yaml using below:

*********************************************************************************
kind: Cluster
apiVersion: kind.x-k8s.io/v1alpha4
nodes:
  - role: control-plane
    kubeadmConfigPatches:
      - |
        apiVersion: kubeadm.k8s.io/v1beta2
        kind: InitConfiguration
        nodeRegistration:
          kubeletExtraArgs:
            node-labels: "ingress-ready=true"
            authorization-mode: "AlwaysAllow"
    extraPortMappings:
      - containerPort: 80
        hostPort: 80
      - containerPort: 443
        hostPort: 443
  - role: worker
  - role: worker

 *********************************************************************************

        b. run  following command 
            kind create cluster --config=kindmultinode.yaml
                    
    5. Verify node.
            kubectl get nodes