Skip to main content
Version: release-0.9

Create a local Kubernetes test cluster

This tutorial introduces how to create a local Kubernetes test cluster using Minikube, K3d, and Kind. These tools make it easy to try out KubeBlocks on your local host, offering a great solution for development, testing, and experimentation without the complexity of creating a full production-grade cluster.

Before you start

Make sure you have the following tools installed on your local host:

  • Docker: All three tools rely on Docker to create containerized Kubernetes clusters.
  • kubectl: The Kubernetes command-line tool for interacting with clusters. Refer to the kubectl installation guide

Create a Kubernetes cluster using Kind

Kind stands for Kubernetes IN Docker. It runs Kubernetes clusters within Docker containers, making it an ideal tool for local Kubernetes testing.

  1. Install Kind. For details, you can refer to Kind Quick Start.

    brew install kind
  2. Create a Kind cluster.

    kind create cluster --name mykindcluster

    This command creates a single-node Kubernetes cluster running in a Docker container.

  3. Check whether the cluster is started and running.

    kubectl get nodes
    >
    NAME STATUS ROLES AGE VERSION
    mykindcluster-control-plane Ready control-plane 25s v1.31.0

    You can see a node named mykindcluster-control-plane from the output, which means the cluster is created successfully.

  4. (Optional) Configure a cluster with multiple nodes.

    Kind also supports clusters with multiple nodes. You can create a multi-node cluster by a configuration file.

    kind: Cluster
    apiVersion: kind.x-k8s.io/v1alpha4
    nodes:
    role: control-plane
    role: worker
    role: worker

    Use the configuration file to create a multi-node cluster.

    kind create cluster --name multinode-cluster --config kind-config.yaml
  5. If you want to delete the Kind cluster, run the command below.

    kind delete cluster --name mykindcluster