I do Kubernetes administration on daily basis a lot. For demo and POC testing purpose, I use local Kubernetes infrastructure implementation called KIND. KIND is a very helpful tool for me, which runs local Kubernetes clusters on my laptop. Kind's long form is Kubernetes in docker. It uses docker containers as nodes and it doesn't require VM. It is very lightweight and capable of running multi nodes cluster.
This is a step by step procedure to install KIND (Kubernetes cluster) on Ubuntu. Make sure you have minimum dual core CPU and 4 GB Ram, Recommended minimum is 2 CPU and 8 GB RAM. Use below commands to download kind binary executable matching to OS installed, change executable permission of kind binary and move it to /usr/local/bin directory.
# For AMD64 / x86_64 [ $(uname -m) = x86_64 ] && curl -Lo ./kind https://kind.sigs.k8s.io/dl/v0.29.0/kind-linux-amd64 # For ARM64 #[ $(uname -m) = aarch64 ] && curl -Lo ./kind https://kind.sigs.k8s.io/dl/v0.29.0/kind-linux-arm64 chmod +x ./kind sudo mv ./kind /usr/local/bin/kind
Before start make sure you have installed docker on Ubuntu. You can refer this article How to install Docker on Ubuntu. For other OS and different version use this article https://kind.sigs.k8s.io/docs/user/quick-start/#installing-from-release-binaries.
After successful installation of kind application, check the version and install one node Kubernetes cluster using following command.
kind version sudo kind create cluster --name=singlenodecluter
Verify kind has deployed single node cluster successfully by get clusters command. To connect Kubernetes cluster you will need to install kubectl client first. Download kubectl binary and move it to /usr/local/bin folder with correct executable permissions, Confirm kubectl is installed correctly by checking its version.
sudo kind get clusters curl -LO https://dl.k8s.io/release/v1.33.0/bin/linux/amd64/kubectl sudo install -o root -g root -m 0755 kubectl /usr/local/bin/kubectl sudo kubectl version
Check other kubectl installation options here: https://kubernetes.io/docs/tasks/tools/install-kubectl-linux/.
Next verify you are able to connect Kubernetes cluster using kubectl command. Try to list nodes, there will be only one node which is hosted on docker as container (you can confirm it by running docker ps command as well). Next deploy a test deployment pod in Kubernetes cluster using kubectl command. Verify pods inside deployment is deployed properly.
sudo kubectl get nodes sudo kubectl create deployment nginx --image nginx sudo kubectl get pods
KIND is using docker containers as nodes in the background, make sure your account has enough permissions over docker. Make your user account to the member of docker group and reboot system. After reboot sudo will not be required every time when you are running kubectl or docker commands and they will not fail.
sudo groupadd docker sudo usermod -aG docker $USER reboot -f docker ps
Official KBs:
https://docs.docker.com/engine/install/linux-postinstall/#manage-docker-as-a-non-root-user
https://kind.sigs.k8s.io/docs/user/known-issues#docker-permission-denied
To install multi node cluster, make swapoff enabled, create yaml file with kind cluster meta information, multiple control-plane and worker. configure inotify so it can support multi node cluster (https://kind.sigs.k8s.io/docs/user/known-issues#pod-errors-due-to-too-many-open-files). To make the inotify changes persistent, edit the file /etc/sysctl.conf and add lines fs.inotify.max_user_watches = 524288 and fs.inotify.max_user_instances = 512. Inotify can be used to monitor individual files, or to monitor directories
In the last execute kind with multi node cluster configuration yaml file to create multi node cluster in Kubernetes.
sudo swapoff -a cat multinodecluster.yaml kind: Cluster apiVersion: kind.x-k8s.io/v1alpha4 nodes: - role: control-plane - role: control-plane - role: control-plane - role: worker - role: worker - role: worker sudo sysctl fs.inotify.max_user_watches=524288 sudo sysctl fs_inotify.max_user_instances=512 kind create cluster --name multinodecluster --config multinodecluster.yaml
Everything is good so far, check the current cluster information using kubectl and deploy pod in it. Once deployment is successful, for testing purpose I am using port forwarding to connect nginx web server on pod from browser. which can be accessed locally for testing.
kubectl cluster-info --context kind-multinodecluster kubectl get nodes kubectl create deployment nginx --image=nginx kubectl get pods kubectl port-forward pod/nginx-5869d7778c-grl95 8080:80
In the last use below command to delete/destroy and cleanup kind Kubernetes cluster.
kind delete cluster --name=multinodecluster
Useful Articles
Part 1 Git version control integration in Visual Studio Code
Part 2 Git master branch source control integration in Visual Studio Code
Part 3 Git clone version control integration in Visual Studio Code
Remote: Permission to UserName/repo.git denied to OtherUserName fatal: unable to access 'https://github.com/UserName/repo.git/': The requested URL returned error: 403
Step by Step guide to push your first project to github.com
Access credential parameters stored in Ansible Tower within a playbook
Part 1 Inject and install VMware Tools During Install by modifying Microsoft Windows ISO
Part 2: Configure IIS server to allow download .ISO files
Part 3: Using HashiCorp Packer to build a Windows Server VM template for VMware vSphere
Terraform clone virtual machine template in VMware vSphere vCenter from CSV file
Terraform error retrieving storage account failure responding to request StatusCode 404 StorageAccountNotFound The storage account was not found









