kind is a tool for running local Kubernetes clusters using Docker containers as cluster nodes. It is developed for testing local Kubernetes clusters, initially targeting the conformance tests. The Kubernetes cluster version depends on the node image that your kind uses, and you can specify the image to be used for the nodes and choose any other published version. Refer to Docker hub to see available tags.
This deployment is for testing only. DO NOT USE in production!
Before deployment, make sure the following requirements are satisfied:
Resources requirement: 2 CPU cores+, Memory 4G+
For macOS, you need to allocate at least 2 CPU cores and 4G Memory to Docker. For details, see Docker configuration for Mac.
Docker: version >= 17.03
Helm Client: version >= 2.9.0 and < 3.0.0
Kubectl: version >= 1.10 (1.13 or later recommended)
The output might vary slightly among different versions of
kind: version >= 0.4.0
The value of net.ipv4.ip_forward should be set to
First, make sure that Docker is running. Then, you can create a local Kubernetes cluster with a script in our repository. Follow the steps below:
Clone the code:
git clone --depth=1 https://github.com/pingcap/tidb-operator && \ cd tidb-operator
Run the script and create a local Kubernetes cluster:
By default, this script starts a Kubernetes cluster of the 1.12.8 version, with six nodes in the cluster and for each node the number of mount points is 9. You can configure these items by startup options.
hack/kind-cluster-build.sh --nodeNum 2 --k8sVersion v1.14.6 --volumeNum 3
To connect the local Kubernetes cluster, set the default configuration file path of kubectl to
export KUBECONFIG="$(kind get kubeconfig-path)"
Verify whether the Kubernetes cluster is on and running:
The output is like this:
Kubernetes master is running at https://127.0.0.1:50295 KubeDNS is running at https://127.0.0.1:50295/api/v1/namespaces/kube-system/services/kube-dns:dns/proxy
storageClass of the cluster:
kubectl get storageClass
The output is like this:
NAME PROVISIONER AGE local-storage kubernetes.io/no-provisioner 7m50s standard (default) kubernetes.io/host-path 8m29s
Refer to the steps in Deploy TiDB Operator.
Refer to the steps in Deploy TiDB on General Kubernetes.
Refer to the steps in View the monitoring dashboard.
To destroy the local TiDB cluster, refer to the steps in Destroy TiDB Clusters in Kubernetes.
To destroy the Kubernetes cluster, execute the following command:
kind delete cluster