Convert Figma logo to code with AI

kubernetes-sigs logokind

Kubernetes IN Docker - local clusters for testing Kubernetes

13,281
1,542
13,281
212

Top Related Projects

29,143

Run Kubernetes locally

5,336

Little helper to run CNCF's k3s in Docker

27,519

Lightweight Kubernetes

Home for Cluster API, a subproject of sig-cluster-lifecycle

VMware Tanzu Community Edition is no longer an actively maintained project. Code is available for historical purposes only.

Quick Overview

Kind (Kubernetes IN Docker) is a tool for running local Kubernetes clusters using Docker container "nodes". It was primarily designed for testing Kubernetes itself, but can be used for local development or CI workflows.

Pros

  • Easy to set up and tear down Kubernetes clusters quickly
  • Supports multi-node clusters, allowing for more realistic testing scenarios
  • Works well in CI/CD pipelines for testing Kubernetes applications
  • Cross-platform compatibility (Linux, macOS, Windows)

Cons

  • Limited performance compared to bare-metal or cloud-based Kubernetes clusters
  • Not suitable for production use cases
  • May consume significant system resources, especially for multi-node clusters
  • Some Kubernetes features may not be fully supported or may behave differently

Getting Started

  1. Install Docker on your system
  2. Install Kind:
    curl -Lo ./kind https://kind.sigs.k8s.io/dl/v0.20.0/kind-linux-amd64
    chmod +x ./kind
    sudo mv ./kind /usr/local/bin/kind
    
  3. Create a cluster:
    kind create cluster
    
  4. Interact with the cluster using kubectl:
    kubectl cluster-info --context kind-kind
    kubectl get nodes
    

To delete the cluster:

kind delete cluster

Competitor Comparisons

29,143

Run Kubernetes locally

Pros of Minikube

  • Supports multiple hypervisors (VirtualBox, VMware, Hyper-V)
  • Offers a dashboard for cluster management
  • Provides add-ons for easy feature integration

Cons of Minikube

  • Slower startup time compared to Kind
  • Higher resource consumption
  • More complex setup process

Code Comparison

Minikube:

minikube start
minikube dashboard
minikube addons enable ingress

Kind:

kind create cluster
kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/master/deploy/static/provider/kind/deploy.yaml

Both Minikube and Kind are tools for running local Kubernetes clusters, but they have different approaches. Minikube creates a single-node cluster inside a VM, while Kind uses Docker containers to simulate a multi-node cluster.

Minikube offers more features out-of-the-box, including a dashboard and various add-ons, making it more user-friendly for beginners. However, this comes at the cost of higher resource usage and slower startup times.

Kind, on the other hand, is lighter and faster, making it ideal for CI/CD environments and quick testing. It's also easier to create multi-node clusters with Kind. However, it lacks some of the convenience features that Minikube provides.

The choice between Minikube and Kind depends on your specific needs, available resources, and familiarity with Kubernetes and container technologies.

5,336

Little helper to run CNCF's k3s in Docker

Pros of k3d

  • Faster cluster creation and teardown due to lightweight nature of k3s
  • Supports multi-node clusters out of the box
  • Easier integration with container registries

Cons of k3d

  • Less feature-complete compared to full Kubernetes implementation
  • May not fully replicate production Kubernetes behavior in all scenarios
  • Limited support for certain advanced Kubernetes features

Code Comparison

k3d cluster creation:

k3d cluster create mycluster

kind cluster creation:

kind create cluster --name mycluster

Both tools offer simple cluster creation commands, but k3d's syntax is slightly more concise. The underlying implementations differ significantly, with k3d using k3s (a lightweight Kubernetes distribution) and kind using Docker containers to simulate nodes.

Both projects aim to provide local Kubernetes environments for development and testing. k3d offers faster setup and teardown times, making it suitable for rapid iteration. kind provides a more complete Kubernetes experience, closely mimicking production environments.

The choice between k3d and kind depends on specific use cases, with k3d excelling in quick, lightweight setups and kind offering a more comprehensive Kubernetes experience for testing and development.

27,519

Lightweight Kubernetes

Pros of k3s

  • Lightweight and resource-efficient, suitable for edge computing and IoT devices
  • Includes built-in storage and load balancing solutions
  • Easier to set up and manage in production environments

Cons of k3s

  • Less faithful representation of a full Kubernetes cluster
  • May not support all Kubernetes features or extensions
  • Limited to a single-node setup by default (multi-node requires additional configuration)

Code Comparison

k3s installation:

curl -sfL https://get.k3s.io | sh -

kind cluster creation:

kind create cluster

Both projects aim to provide lightweight Kubernetes environments, but they serve different purposes. k3s is designed for production use in resource-constrained environments, while kind is primarily for local development and testing.

k3s simplifies Kubernetes by removing unnecessary features and bundling essential components, making it more suitable for edge computing and IoT scenarios. On the other hand, kind creates a more complete Kubernetes environment using Docker containers, which is ideal for developers who need a local setup that closely mimics a full Kubernetes cluster.

The installation process for k3s is straightforward, often requiring just a single command. kind, while also simple to set up, typically requires Docker to be installed first and may involve more steps for advanced configurations.

In terms of resource usage, k3s has a smaller footprint, which is beneficial for production deployments on limited hardware. kind, being container-based, may consume more resources but offers greater flexibility for testing different Kubernetes versions and configurations.

Home for Cluster API, a subproject of sig-cluster-lifecycle

Pros of Cluster API

  • Supports multiple infrastructure providers (cloud, on-premises, virtualized)
  • Enables declarative, GitOps-friendly cluster management
  • Scales well for managing multiple clusters across different environments

Cons of Cluster API

  • Steeper learning curve and more complex setup compared to Kind
  • Requires additional components and infrastructure management
  • May be overkill for simple local development or testing scenarios

Code Comparison

Kind:

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

Cluster API:

apiVersion: cluster.x-k8s.io/v1beta1
kind: Cluster
metadata:
  name: my-cluster
spec:
  clusterNetwork:
    pods:
      cidrBlocks: ["192.168.0.0/16"]

While Kind focuses on creating local Kubernetes clusters using Docker containers, Cluster API provides a more comprehensive solution for managing clusters across various infrastructure providers. Kind is simpler to set up and use for local development, while Cluster API offers greater flexibility and scalability for production environments. The code examples show the difference in complexity, with Kind requiring minimal configuration compared to Cluster API's more detailed specifications.

VMware Tanzu Community Edition is no longer an actively maintained project. Code is available for historical purposes only.

Pros of Community Edition

  • Offers a more comprehensive Kubernetes platform with additional features and tools
  • Provides a production-ready environment suitable for enterprise use
  • Includes built-in package management and application lifecycle features

Cons of Community Edition

  • More complex setup and configuration compared to Kind
  • Requires more system resources due to its broader feature set
  • May have a steeper learning curve for beginners

Code Comparison

Kind:

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

Community Edition:

apiVersion: run.tanzu.vmware.com/v1alpha1
kind: TanzuKubernetesCluster
metadata:
  name: my-cluster
spec:
  distribution:
    version: v1.21.2

Both projects aim to simplify Kubernetes deployment, but Kind focuses on local development and testing, while Community Edition provides a more comprehensive platform for production use. Kind is lighter and easier to set up, making it ideal for quick testing and CI/CD pipelines. Community Edition offers a fuller Kubernetes experience with additional features, making it suitable for larger-scale deployments and enterprise environments.

Convert Figma logo designs to code with AI

Visual Copilot

Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.

Try Visual Copilot

README

kind

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.16+ and docker, podman or nerdctl installed go install sigs.k8s.io/kind@v0.24.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

For a complete install guide see the documentation here.

You can install kind with go install sigs.k8s.io/kind@v0.24.0.

NOTE: please use the latest go to do this. KIND is developed with the latest stable go, see .go-version for the exact version we're using.

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 Linux:

# For AMD64 / x86_64
[ $(uname -m) = x86_64 ] && curl -Lo ./kind https://kind.sigs.k8s.io/dl/v0.24.0/kind-$(uname)-amd64
# For ARM64
[ $(uname -m) = aarch64 ] && curl -Lo ./kind https://kind.sigs.k8s.io/dl/v0.24.0/kind-$(uname)-arm64
chmod +x ./kind
sudo mv ./kind /usr/local/bin/kind

On macOS via Homebrew:

brew install kind

On macOS via MacPorts:

sudo port selfupdate && sudo port install kind

On macOS via Bash:

# For Intel Macs
[ $(uname -m) = x86_64 ] && curl -Lo ./kind https://kind.sigs.k8s.io/dl/v0.24.0/kind-darwin-amd64
# For M1 / ARM Macs
[ $(uname -m) = arm64 ] && curl -Lo ./kind https://kind.sigs.k8s.io/dl/v0.24.0/kind-darwin-arm64
chmod +x ./kind
mv ./kind /some-dir-in-your-PATH/kind

On Windows:

curl.exe -Lo kind-windows-amd64.exe https://kind.sigs.k8s.io/dl/v0.24.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 @aojea and @BenTheElder - 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 or docker, 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.