k3d commands
27 commands in 5 groups: Install, Manage, Nodes & Registries, Images, List & Inspect. Click or tap any command to copy it. Official documentation: k3d.io.
Open in the interactive cheat sheet search, stars and every other section
Install
Install k3d, a lightweight wrapper that runs k3s clusters in Docker containers.
curl -s https://raw.githubusercontent.com/k3d-io/k3d/main/install.sh | bash
Install k3d via official script
brew install k3d
Install k3d via Homebrew
k3d version
Print k3d version
Manage
Create, start, stop, and delete lightweight Kubernetes clusters using k3d.
k3d cluster create <name>
Create a k3d cluster
k3d cluster delete <name>
Delete a k3d cluster
k3d cluster start <name>
Start a stopped k3d cluster
k3d cluster stop <name>
Stop a running k3d cluster
k3d cluster create <name> --agents <n>
Create a multi-agent cluster
k3d cluster create <name> --image <image>
Create with a specific k3s image
k3d cluster create <name> --k3s-arg "--disable=traefik@server:0"
Create cluster with custom k3s args
k3d cluster create <name> --registry-create <registry-name>
Create cluster with a local registry
k3d cluster create <name> --servers <n>
Create a multi-server (HA) cluster
k3d cluster create <name> -p "8081:80@loadbalancer"
Create cluster with port mapping
k3d cluster delete --all
Delete all k3d clusters
Nodes & Registries
Manage individual k3d nodes and container registries for local image distribution.
k3d node delete <name>
Delete a k3d node
k3d node list
List all k3d nodes
k3d node create <name> --cluster <cluster>
Add a node to an existing cluster
k3d registry delete <name>
Delete a k3d registry
k3d registry list
List all k3d registries
k3d registry create <name> --port <port>
Create a local container registry
Images
Import local container images into k3d clusters for testing without a registry.
k3d image import <image> -c <cluster>
Import an image into a cluster
k3d image import <image1> <image2> -c <cluster>
Import multiple images
k3d image import <tar> -c <cluster>
Import from a tar archive
List & Inspect
List clusters, nodes, registries, and retrieve kubeconfig for cluster access.
k3d cluster list
List all k3d clusters
k3d kubeconfig get <name>
Get kubeconfig for a cluster
k3d kubeconfig merge <name> --kubeconfig-switch-context
Merge kubeconfig and switch context
k3d node list
List all k3d nodes