kind

command module
v0.22.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 14, 2024 License: Apache-2.0 Imports: 1 Imported by: 5

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 or podman installed go install sigs.k8s.io/kind@v0.21.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.21.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.21.0/kind-$(uname)-amd64
# For ARM64
[ $(uname -m) = aarch64 ] && curl -Lo ./kind https://kind.sigs.k8s.io/dl/v0.21.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.21.0/kind-darwin-amd64
# For M1 / ARM Macs
[ $(uname -m) = arm64 ] && curl -Lo ./kind https://kind.sigs.k8s.io/dl/v0.21.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.21.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.

Documentation

Overview

This package is a stub main wrapping cmd/kind.Main()

Directories

Path Synopsis
cmd
kindnetd Module
hack
tools Module
images
kindnetd Module
pkg
apis/config/defaults
Package defaults contains cross-api-version configuration defaults
Package defaults contains cross-api-version configuration defaults
apis/config/v1alpha4
Package v1alpha4 implements the v1alpha4 apiVersion of kind's cluster configuration
Package v1alpha4 implements the v1alpha4 apiVersion of kind's cluster configuration
build/nodeimage
Package nodeimage implements functionality to build the kind node image
Package nodeimage implements functionality to build the kind node image
build/nodeimage/internal/container/docker
Package docker contains helpers for working with docker This package has no stability guarantees whatsoever!
Package docker contains helpers for working with docker This package has no stability guarantees whatsoever!
build/nodeimage/internal/kube
Package kube implements functionality to build Kubernetes for the purposes of installing into the kind node image
Package kube implements functionality to build Kubernetes for the purposes of installing into the kind node image
cluster
Package cluster implements kind kubernetes-in-docker cluster management
Package cluster implements kind kubernetes-in-docker cluster management
cluster/constants
Package constants contains well known constants for kind clusters
Package constants contains well known constants for kind clusters
cluster/internal/create/actions/config
Package config implements the kubeadm config action
Package config implements the kubeadm config action
cluster/internal/create/actions/installcni
Package installcni implements the install CNI action
Package installcni implements the install CNI action
cluster/internal/create/actions/installstorage
Package installstorage implements the an action to install a default storageclass
Package installstorage implements the an action to install a default storageclass
cluster/internal/create/actions/kubeadminit
Package kubeadminit implements the kubeadm init action
Package kubeadminit implements the kubeadm init action
cluster/internal/create/actions/kubeadmjoin
Package kubeadmjoin implements the kubeadm join action
Package kubeadmjoin implements the kubeadm join action
cluster/internal/create/actions/loadbalancer
Package loadbalancer implements the load balancer configuration action
Package loadbalancer implements the load balancer configuration action
cluster/internal/create/actions/waitforready
Package waitforready implements the wait for ready action
Package waitforready implements the wait for ready action
cluster/internal/kubeadm
Package kubeadm contains kubeadm related constants and configuration
Package kubeadm contains kubeadm related constants and configuration
cluster/internal/kubeconfig
Package kubeconfig provides utilities kind uses internally to manage kind cluster kubeconfigs
Package kubeconfig provides utilities kind uses internally to manage kind cluster kubeconfigs
cluster/internal/loadbalancer
Package loadbalancer contains external loadbalancer related constants and configuration
Package loadbalancer contains external loadbalancer related constants and configuration
cluster/internal/logs
Package logs contains tooling for obtaining cluster logs
Package logs contains tooling for obtaining cluster logs
cluster/internal/providers/common
Package common contains common code for implementing providers
Package common contains common code for implementing providers
cluster/nodes
Package nodes provides a kind specific definition of a cluster node
Package nodes provides a kind specific definition of a cluster node
cluster/nodeutils
Package nodeutils contains functionality for Kubernetes-in-Docker nodes It mostly exists to break up functionality from sigs.k8s.io/kind/pkg/cluster
Package nodeutils contains functionality for Kubernetes-in-Docker nodes It mostly exists to break up functionality from sigs.k8s.io/kind/pkg/cluster
cmd
Package cmd provides helpers used by kind's commands / cli
Package cmd provides helpers used by kind's commands / cli
cmd/kind
Package kind implements the root kind cobra command, and the cli Main()
Package kind implements the root kind cobra command, and the cli Main()
cmd/kind/build
Package build implements the `build` command
Package build implements the `build` command
cmd/kind/completion
Package completion implements the `completion` command
Package completion implements the `completion` command
cmd/kind/completion/bash
Package bash implements the `bash` command
Package bash implements the `bash` command
cmd/kind/completion/fish
Package fish implements the `fish` command
Package fish implements the `fish` command
cmd/kind/completion/zsh
Package zsh implements the `zsh` command
Package zsh implements the `zsh` command
cmd/kind/create
Package create implements the `create` command
Package create implements the `create` command
cmd/kind/create/cluster
Package cluster implements the `create cluster` command
Package cluster implements the `create cluster` command
cmd/kind/delete
Package delete implements the `delete` command
Package delete implements the `delete` command
cmd/kind/delete/cluster
Package cluster implements the `delete` command
Package cluster implements the `delete` command
cmd/kind/delete/clusters
Package clusters implements the `delete` command for multiple clusters
Package clusters implements the `delete` command for multiple clusters
cmd/kind/export
Package export implements the `export` command
Package export implements the `export` command
cmd/kind/export/kubeconfig
Package kubeconfig implements the `kubeconfig` command
Package kubeconfig implements the `kubeconfig` command
cmd/kind/export/logs
Package logs implements the `logs` command
Package logs implements the `logs` command
cmd/kind/get
Package get implements the `get` command
Package get implements the `get` command
cmd/kind/get/clusters
Package clusters implements the `clusters` command
Package clusters implements the `clusters` command
cmd/kind/get/kubeconfig
Package kubeconfig implements the `kubeconfig` command
Package kubeconfig implements the `kubeconfig` command
cmd/kind/get/nodes
Package nodes implements the `nodes` command
Package nodes implements the `nodes` command
cmd/kind/load
Package load implements the `load` command
Package load implements the `load` command
cmd/kind/load/docker-image
Package load implements the `load` command
Package load implements the `load` command
cmd/kind/load/image-archive
Package load implements the `load` command
Package load implements the `load` command
cmd/kind/version
Package version implements the `version` command
Package version implements the `version` command
errors
Package errors provides common utilities for dealing with errors
Package errors provides common utilities for dealing with errors
exec
Package exec contains an interface for executing commands, along with helpers TODO(bentheelder): add standardized timeout functionality & a default timeout so that commands cannot hang indefinitely (!)
Package exec contains an interface for executing commands, along with helpers TODO(bentheelder): add standardized timeout functionality & a default timeout so that commands cannot hang indefinitely (!)
fs
Package fs contains utilities for interacting with the host filesystem in a docker friendly way TODO(bentheelder): this should be internal
Package fs contains utilities for interacting with the host filesystem in a docker friendly way TODO(bentheelder): this should be internal
internal/apis/config
Package config implements the current apiVersion of the `kind` Config along with some common abstractions
Package config implements the current apiVersion of the `kind` Config along with some common abstractions
internal/apis/config/encoding
Package encoding implements utilities for decoding from yaml the `kind` Config
Package encoding implements utilities for decoding from yaml the `kind` Config
internal/patch
Package patch contains helpers for applying patches
Package patch contains helpers for applying patches
internal/sets
Package sets implements set types.
Package sets implements set types.
internal/version
Package version provides utilities for version number comparisons
Package version provides utilities for version number comparisons
log
Package log defines a logging interface that kind uses This is roughly a minimal subset of klog github.com/kubernetes/klog
Package log defines a logging interface that kind uses This is roughly a minimal subset of klog github.com/kubernetes/klog

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL