Skip to content

Kind Kubernetes Cluster

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. It is the easiest way to test Kraken K8S on a local machine.

Note

You may also consider Minikube to test Kraken, but be aware that it does not handle multiple Nodes.

Kind Installation

First, you need to install Docker:

sudo apt-get update
sudo apt-get install docker-ce docker-ce-cli containerd.io

Then install Kind:

curl -Lo ./kind https://github.com/kubernetes-sigs/kind/releases/download/v0.8.1/kind-linux-amd64
chmod +x ./kind
sudo mv ./kind /usr/local/bin/kind

Create a Kind configuration file with an Ingress controller:

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
  - role: worker

Start a local cluster with the command:

kind create cluster --config kind-config.yaml

The cluster is created with one control plane and three worker nodes:

Creating cluster "kind" ...
 ✓ Ensuring node image (kindest/node:v1.16.3) đŸ–ŧ
 ✓ Preparing nodes đŸ“Ļ 
 ✓ Writing configuration 📜 
 ✓ Starting control-plane 🕹ī¸ 
 ✓ Installing CNI 🔌 
 ✓ Installing StorageClass 💾 
 ✓ Joining worker nodes 🚜 
Set kubectl context to "kind-kind"
You can now use your cluster with:

kubectl cluster-info --context kind-kind

Thanks for using kind! 😊

Ingress Controller

Activate the Ingress controller:

kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/master/deploy/static/provider/kind/deploy.yaml
kubectl wait --namespace ingress-nginx --for=condition=ready pod --selector=app.kubernetes.io/component=controller --timeout=90s

Your local cluster being ready, you can now install Helm.

Note

If you want to use local Docker images of Kraken, you can copy then into your Kind K8S cluster with the command: kind load docker-image octoperf/kraken-image:tag