How kubernetes-sigs/kind works
kind is a CLI and Go library for creating and managing local Kubernetes clusters in containers. The main workflow is: a user invokes kind, the CLI configures a cluster request, the create orchestrator provisions nodes through a selected Docker, Podman, or nerdctl provider, then runs kubeadm and cluster setup actions; users can later retrieve access configuration, inspect or export logs, load images, and delete clusters. The tree also contains kindnetd networking code. Edges reflect documented capabilities and sampled call sites; unsampled command wiring and kindnetd integration details are kept conservative.
Main entry points: provider.go Provider API · root.go Command tree · createcluster.go Create command · deletecluster.go Manage commands
Components 22
CLI
- CLI application
cmd/kind/app/main.go - Command tree
pkg/cmd/kind/root.go - Create command
pkg/cmd/kind/create/cluster/createcluster.go - Manage commands
pkg/cmd/kind/delete/cluster/deletecluster.go - Export commands
pkg/cmd/kind/export/export.go - Load commands
pkg/cmd/kind/load/load.go
Cluster lifecycle
- Provider API
pkg/cluster/provider.go - Cluster config
pkg/internal/apis/config/encoding/load.go - Create orchestrator
pkg/cluster/internal/create/create.go - Node setup actions
pkg/cluster/internal/create/actions/action.go - Kubeconfig
pkg/cluster/internal/kubeconfig/kubeconfig.go - Cluster deletion
pkg/cluster/internal/delete/delete.go - Log collection
pkg/cluster/internal/logs/logs.go
Container runtimes
- Docker provider
pkg/cluster/internal/providers/docker/provider.go - Podman provider
pkg/cluster/internal/providers/podman/provider.go - nerdctl provider
pkg/cluster/internal/providers/nerdctl/provider.go
Cluster networking
- kindnetd agent
images/kindnetd/cmd/kindnetd/main.go - Route sync
images/kindnetd/cmd/kindnetd/routes.go - CNI setup
pkg/cluster/internal/create/actions/installcni/cni.go
Other components
- User
- Container engine
- Kubernetes API
Connections 26
- User → CLI application: runs
- CLI application → Command tree: executes
- Command tree → Create command: dispatches
- Command tree → Manage commands: dispatches
- Command tree → Export commands: dispatches
- Command tree → Load commands: dispatches
- Create command → Provider API: creates via
- Create command → Cluster config: loads
- Provider API → Create orchestrator: creates cluster
- Create orchestrator → Node setup actions: runs actions
- Node setup actions → CNI setup: installs CNI
- Node setup actions → Kubernetes API: configures cluster
- Provider API → Docker provider: selects
- Provider API → Podman provider: selects
- Provider API → nerdctl provider: selects
- Docker provider → Container engine: controls
- Podman provider → Container engine: controls
- nerdctl provider → Container engine: controls
- Manage commands → Provider API: manages via
- Provider API → Cluster deletion: deletes cluster
- Export commands → Provider API: gets config
- Provider API → Kubeconfig: retrieves
- Manage commands → Log collection: collects logs
- Load commands → Provider API: loads images
- kindnetd agent → Kubernetes API: watches nodes
- kindnetd agent → Route sync: syncs routes