Kind

Kubernetes IN Docker -- 用于测试Kubernetes的本地集群。「Kubernetes IN Docker - local clusters for testing Kubernetes」

Github stars Tracking Chart

更多深入的安装等信息请参见我们的文档

kind 是一个使用 Docker 容器 "nodes" 运行本地 Kubernetes 集群的工具。

kind 主要是为测试 Kubernetes 本身而设计的,但也可以用于本地开发或 CI。

如果你有 go1.11+)且安装了 docker,那么运行 GO111MODULE="on" go get sigs.k8s.io/kind@v0.9.0 && kind create cluster 就可以了!

kind 由以下部分组成:

kind 用 kubeadm 引导每个"node"。更多细节请参见设计文档

注意:kind 仍在开发中,请参阅 1.0 路线图

安装和使用

完整的安装指南请看这里的文档

你可以用 GO111MODULE="on" go get sigs.k8s.io/kind@v0.9.0 来安装 kind。

注意:请使用最新的 go 进行安装,最好是 go 1.13 或更高版本。

注意:go get 不应该从启用了 go [modules] 的项目目录中运行,因为在启用了 modules 的项目中 go get 会更新依赖关系/表现不同。例如,先试试 cd $HOME。

这将会把 kind 放在 $(go env GOPATH)/bin 中。如果你在安装后遇到 kind: command not found 的错误,那么你可能需要如这里所示将该目录添加到你的 $PATH 中,或者通过克隆 repo 并从仓库中运行 make build 来进行手动安装。

在没有安装 go 的情况下,kind 可以使用 docker 使用 make build 进行可复制的构建。

稳定的二进制文件也可以在发布页面上找到。一般来说,特别是在 CI 使用时,推荐使用稳定版。要安装,请从 "Assets" 中下载适合您平台的二进制文件,并将其放入您的 $PATH 中。

在 Mac 和 Linux 上

curl -Lo ./kind "https://kind.sigs.k8s.io/dl/v0.9.0/kind-$(uname)-amd64"
chmod +x ./kind
mv ./kind /some-dir-in-your-PATH/kind
</p>
<p>在 Mac 上通过 Homebrew:
</p>
<pre>brew install kind

在 Windows 上:

curl.exe -Lo kind-windows-amd64.exe https://kind.sigs.k8s.io/dl/v0.9.0/kind-windows-amd64
Move-Item .\kind-windows-amd64.exe c:\some-dir-in-your-PATH\kind.exe
# OR via Chocolatey (https://chocolatey.org/packages/kind)
choco install kind

要使用 kind,你需要安装 docker。

一旦你运行了docker,你就可以用以下方法创建一个集群。

kind create cluster

要删除您的集群,请使用

kind delete cluster

要从 Kubernetes 源代码创建一个集群。

确保 Kubernetes 被克隆在 $(go env GOPATH)/src/k8s.io/kubernetes 中。

构建一个节点映像并创建一个集群。

kind build node-image
kind create cluster --image kindest/node:latest

多节点集群和其他高级功能可以用配置文件来配置,更多的用法请看文档或运行 kind [command] --help。

社区

请为 BUG、功能请求和其他问题提供帮助!

本项目的维护者可以通过以下方式联系。

目前的维护者是 @BenTheElder 和 @munnerz -- 如果您有任何问题,请随时联系我们。

我们非常欢迎拉取请求!

如果你正在计划一个新功能,请先提交一个问题来讨论。

如果你不知道从哪里开始,请查看问题跟踪器中的帮助需求问题,或者随时联系我们进行讨论。 微笑脸

另请参阅:我们自己的贡献者指南和 Kubernetes 社区页面

为什么选择 kind?

  • kind 支持多节点(包括 HA)集群。
  • kind 支持从源代码构建 Kubernetes 的发布版构建
  • 支持make/bash/docker或bazel,以及预先发布的构建。
  • 支持Linux、MacOS和Windows
  • kind 是一个经过 CNCF 认证的符合 Kubernetes 安装程序

行为守则

参与 Kubernetes 社区受 Kubernetes 行为准则的约束

(The first version translated by vz on 2020.10.10)

Overview

Name With Ownerkubernetes-sigs/kind
Primary LanguageGo
Program languageGo (Language Count: 7)
PlatformLinux, Mac, Windows, Kubernetes
License:Apache License 2.0
Release Count40
Last Release Namev0.23.0-alpha (Posted on )
First Release Namev0.0.1 (Posted on )
Created At2018-09-12 21:45:05
Pushed At2024-05-03 09:27:34
Last Commit At
Stargazers Count12.8k
Watchers Count140
Fork Count1.5k
Commits Count4.2k
Has Issues Enabled
Issues Count1780
Issue Open Count181
Pull Requests Count1393
Pull Requests Open Count26
Pull Requests Close Count399
Has Wiki Enabled
Is Archived
Is Fork
Is Locked
Is Mirror
Is Private

Please see Our Documentation for more in-depth installation etc.

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.

If you have go (1.11+) and docker installed GO111MODULE="on" go get sigs.k8s.io/kind@v0.7.0 && kind create cluster is all you need!

kind consists of:

kind bootstraps each "node" with kubeadm. For more details see the design documentation.

NOTE: kind is still a work in progress, see the 1.0 roadmap.

Installation and usage

You can install kind with GO111MODULE="on" go get sigs.k8s.io/kind@v0.7.0.

NOTE: please use the latest go to do this, ideally go 1.13 or greater.

This will put kind in $(go env GOPATH)/bin. If you encounter the error
kind: command not found after installation then you may need to either add that directory to your $PATH as
shown here or do a manual installation by cloning the repo and run
make build from the repository.

Without installing go, kind can be built reproducibly with docker using make build.

Stable binaries are also available on the releases page. Stable releases are
generally recommended for CI usage in particular.
To install, download the binary for your platform from "Assets" and place this
into your $PATH:

On Mac & Linux:

curl -Lo ./kind "https://github.com/kubernetes-sigs/kind/releases/download/v0.7.0/kind-$(uname)-amd64"
chmod +x ./kind
mv ./kind /some-dir-in-your-PATH/kind

On Mac via Homebrew:

brew install kind

On Windows:

curl.exe -Lo kind-windows-amd64.exe https://github.com/kubernetes-sigs/kind/releases/download/v0.7.0/kind-windows-amd64
Move-Item .\kind-windows-amd64.exe c:\some-dir-in-your-PATH\kind.exe

# OR via Chocolatey (https://chocolatey.org/packages/kind)
choco install kind

To use kind, you will need to install docker.
Once you have docker running you can create a cluster with:

kind create cluster

To delete your cluster use:

kind delete cluster

To create a cluster from Kubernetes source:

  • ensure that Kubernetes is cloned in $(go env GOPATH)/src/k8s.io/kubernetes
  • build a node image and create a cluster with:
kind build node-image
kind create cluster --image kindest/node:latest

Multi-node clusters and other advanced features may be configured with a config
file, for more usage see the docs or run kind [command] --help

Community

Please reach out for bugs, feature requests, and other issues!
The maintainers of this project are reachable via:

Current maintainers are @BenTheElder and @munnerz - feel free to
reach out if you have any questions!

Pull Requests are very welcome!
If you're planning a new feature, please file an issue to discuss first.

Check the issue tracker for help wanted issues if you're unsure where to
start, or feel free to reach out to discuss. ?

See also: our own contributor guide and the Kubernetes community page.

Why kind?

  • kind supports multi-node (including HA) clusters
  • kind supports building Kubernetes release builds from source
    • support for make / bash / docker or bazel, in addition to pre-published builds
  • kind supports Linux, macOS and Windows
  • kind is a CNCF certified conformant Kubernetes installer

Code of conduct

Participation in the Kubernetes community is governed by the Kubernetes Code of Conduct.

To the top