Solution Architect | Technical Content Writer
If you've spent days (or even weeks?) trying to spin up a Kubernetes cluster for learning purposes or to test your application, then your worries are over. Spawned from a Kubernetes Special Interest Group, KIND is a tool that provisions a Kubernetes cluster running IN Docker.
From the docs:
kind is a tool for running local Kubernetes clusters using Docker container "nodes". kind is primarily designed for testing Kubernetes 1.11+, initially targeting the conformance tests.
As it is built using go, you will need to make sure you have the latest version of
installed on your machine.
According to the k8s docs,
is preferred. To install kind, run these commands (it takes a while):
golang -v 1.11.5
go get -u sigs.k8s.io/kind kind create cluster
Then confirm kind cluster is available:
kind get clusters
Also, install the latest
using Homebrew or Chocolatey.
. Check its version by running this command:
Make sure it shows
from Docker, try
or reorder path environment variable.
and kind are ready, open bash console and run these commands:
export KUBECONFIG=”$(kind get kubeconfig-path)” kubectl cluster-info
is properly set up, some information will be shown.
What should we deploy on the cluster? We are going to attempt deploying Cassandra since the docs have a pretty decent walk-through on it.
files are prepared, layout them as following:
k8s-wp/ kustomization.yaml mysql-deployment.yaml wordpress-deployment.yaml
Then apply them to your cluster:
cd k8s-wp kubectl apply -k ./
Get the Cassandra Service.
kubectl get svc cassandra
The response is:
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE cassandra ClusterIP None <none> 9042/TCP 45s
Note that Service creation might have failed if anything else is returned. Read Debug Services for common issues.
That's really all you need to know to get started with KIND, I hope this makes your life a little easier and lets you play with Kubernetes a little bit more :)
About the author - Sudip is a Solution Architect with more than 15 years of working experience, and is the founder of Javelynn. He likes sharing his knowledge by regularly writing for Hackernoon, DZone, Appfleet and many more. And while he is not doing that, he must be fishing or playing chess.
Previously posted at https://appfleet.com/.
Create your free account to unlock your custom reading experience.