Linux command
kind 命令
文本
复制后可按需替换文件名、目录或参数。
常用示例
Create cluster
kind create cluster
Create named cluster
kind create cluster --name [my-cluster]
Create with config
kind create cluster --config [kind-config.yaml]
List clusters
kind get clusters
Delete cluster
kind delete cluster --name [my-cluster]
Load image to cluster
kind load docker-image [myimage:tag] --name [my-cluster]
说明
kind (Kubernetes IN Docker) creates and manages local Kubernetes clusters using Docker containers as nodes. Each cluster node runs as a separate Docker container with systemd, kubelet, and containerd inside it, providing a lightweight alternative to virtual machine-based solutions like minikube for local development and CI/CD testing. The tool supports multi-node clusters including multiple control plane nodes for testing high-availability configurations, and accepts YAML configuration files to customize node counts, port mappings, mounted volumes, and Kubernetes feature gates. Local Docker images can be loaded directly into the cluster without pushing to a registry, which accelerates the inner development loop. kind was created by the Kubernetes SIG Testing team and is used extensively in the Kubernetes project's own CI pipelines. It is optimized for fast cluster creation and teardown, making it well-suited for automated testing workflows, but is not intended for production use.
参数
- create cluster
- Create a new cluster. Takes flags such as --name, --config, --image, --kubeconfig, --wait, --retain.
- delete cluster
- Delete a cluster by name.
- delete clusters
- Delete all kind clusters.
- get clusters
- List currently running kind clusters.
- get nodes
- List the Docker containers acting as nodes for a given cluster.
- get kubeconfig
- Print the kubeconfig for a cluster to stdout.
- export kubeconfig --name _NAME_
- Merge the cluster's credentials into the active kubeconfig file.
- export logs _DIR_
- Export logs from all nodes of the cluster to _DIR_.
- load docker-image _IMAGE_
- Sideload a local Docker image into the cluster nodes.
- load image-archive _FILE_
- Sideload an image archive (docker save output) into the cluster nodes.
- build node-image
- Build a kind node image from Kubernetes source or a release tarball.
- version
- Print the kind version.
- --name _NAME_
- Cluster name (default kind).
- --config _FILE_
- Path to a kind configuration YAML file.
- --image _IMAGE_
- Node image to use (overrides the default kindest/node image).
- --kubeconfig _FILE_
- Write the cluster kubeconfig to _FILE_ instead of the default.
- --wait _DURATION_
- Wait up to _DURATION_ for control plane readiness.
- --retain
- Keep nodes when cluster creation fails (useful for debugging).
- --help
- Display help information.
FAQ
What is the kind command used for?
kind (Kubernetes IN Docker) creates and manages local Kubernetes clusters using Docker containers as nodes. Each cluster node runs as a separate Docker container with systemd, kubelet, and containerd inside it, providing a lightweight alternative to virtual machine-based solutions like minikube for local development and CI/CD testing. The tool supports multi-node clusters including multiple control plane nodes for testing high-availability configurations, and accepts YAML configuration files to customize node counts, port mappings, mounted volumes, and Kubernetes feature gates. Local Docker images can be loaded directly into the cluster without pushing to a registry, which accelerates the inner development loop. kind was created by the Kubernetes SIG Testing team and is used extensively in the Kubernetes project's own CI pipelines. It is optimized for fast cluster creation and teardown, making it well-suited for automated testing workflows, but is not intended for production use.
How do I run a basic kind example?
Run `kind create cluster` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does create cluster do in kind?
Create a new cluster. Takes flags such as --name, --config, --image, --kubeconfig, --wait, --retain.