In this tutorial, we will learn about “How to Install Kubernetes with Kind Tool on MacOS using step by step guide“. I have passion of learning new technologies all the time. I have been learning to build and deploy applications on Kubernetes clusters. One of the major challenge I had faced when I started with Kubernetes was to setup a local Kubernetes cluster for development. This is the most important part of development as local setup speeds up the development and make your life easier to test, debug and deploy the application.
We will learn about one such tool called Kind which helps the developers to setup a local Kubernetes cluster. So, let us get started and explore the tool in this tutorial.
What is Kind in Kubernetes?
The Kind tool basically stands for “Kubernetes in Docker”. If you are learning Kubernetes or has the prior experience in it, you must have heard of a tool known as “minikube” which allows you to create a Kubernetes cluster of one node in your local setup. Similarly, “Kind” is also a tool which allows a developer to create a Kubernetes cluster where nodes are the Docker containers.
Why we use Kind to Install Kubernetes?
Also Read: How to Create Postgres Docker Container in Windows [Step by Step Guide]
There are many tools available which helps you to create a local Kubernetes cluster for your development tasks. Some of these tools are Minikube, Kind, K3s, MicroK8s, Okteto etc. Each of these tools has its own importance and are used based on use cases and requirement. The Kind tool is support on all three platforms i.e Linux, Windows and MacOS. The installation and setup of Kind tool is pretty straight forward which we will see in the next section.
How to Install Kubernetes with Kind on MacOS [Step by Step Guide]
The way Kind tool works is that when you install the tool, it spin up Docker containers. These containers act like cluster nodes which are based on an image created by Kind. Follow below simple steps to install the Kind tool on MacOS.
Prerequisite
- Go version 1.16 or later Installed.
- Docker or Podman Installed.
Step-1: Install Kubectl
In this step, update and upgrade the brew package manager using below command. This will update the repository with all the package’s latest version and obsolete the outdated packages.
[email protected] ~ % brew update && brew upgrade
Next, Install the Kubectl package using below command. Kubectl is a utility which is used to interact with Kubernetes resources via API. So, when you will create a local cluster using Kind, Kubectl will be used to interact with all the Kubernetes resources.
[email protected] ~ % brew install kubectl
Next, verify the installation by checking the kubectl version.
[email protected] ~ % kubectl version --client Client Version: v1.29.1 Kustomize Version: v5.0.4-0.20230601165947-6ce0bf390ce3
Step-2: Install Kind
When it comes to installing Kind tool, there are different ways available to install. Let us look at these methods one by one.
Install with Package Manager
This is the native method to install Kind tool on MacOS. You simply need to execute a single command which will install the Kind tool in your system as shown below.
[email protected] ~ % brew install kind
Install from Release Binaries
In this method of installation, visit the kind release page and select the tool version you want to install. At the time of writing this article, version0.22.0 is the latest version of Kind tool available.
Next, download the Kind binary using one of the below command, depending on your MacOS chip.
For Intel Macs
[email protected] ~ % curl -Lo ./kind https://kind.sigs.k8s.io/dl/v0.22.0/kind-darwin-amd64
For M1 / ARM Macs
[email protected] ~ % curl -Lo ./kind https://kind.sigs.k8s.io/dl/v0.22.0/kind-darwin-arm64
Next, assign the execution permission to the download Kind binary file and place the binary into your system variable$PATH at your preferred binary installation directory.
[email protected] ~ % chmod +x ./kind [email protected] ~ % mv ./kind /some-dir-in-your-PATH/kind
Install with go install
To install the Kind tool using go command, you have to make sure that go is pre-installed in your system otherwise this method will not work. Once you verified the go, you need to download the Kind and its dependent packages using below command.
[email protected] ~ % go get sigs.k8s.io/[email protected]
After the packages are downloaded, you can install the Kind tool globally using below command.
[email protected] ~ % go install sigs.k8s.io/[email protected]
Step-3: Verify the Installation
In this step, after the Kind tool is installed, you can verify if the installation is successful by executing the Kind binary. If the output returns the man page of Kind tool, it means installation is done successfully.
[email protected] ~ % kind
Summary
We have successfully installed Kind tool on MacOS. To learn more about the tool, visit the official user guide documentation here.