k3s is the lightweight Kubernetes distribution by Rancher: rancher/k3s
k3d creates containerized k3s clusters. This means, that you can spin up a multi-node k3s cluster on a single machine using docker.
You have several options there:
wget -q -O - https://raw.githubusercontent.com/rancher/k3d/main/install.sh | bash
curl -s https://raw.githubusercontent.com/rancher/k3d/main/install.sh | bash
TAG
environment variable):wget -q -O - https://raw.githubusercontent.com/rancher/k3d/main/install.sh | TAG=v3.0.0 bash
curl -s https://raw.githubusercontent.com/rancher/k3d/main/install.sh | TAG=v3.0.0 bash
brew install k3d
(Homebrew is available for MacOS and Linux)yay -S rancher-k3d-bin
go install github.com/rancher/k3d
(Note: this will give you unreleased/bleeding-edge changes)or…
git clone git@github.com:rancher/k3d.git
or go get github.com/rancher/k3d/v3@main
make build
to build for your current systemgo install
to install it to your GOPATH
(Note: this will give you unreleased/bleeding-edge changes)make build-cross
to build for all systemsCheck out what you can do via k3d help
or check the docs @ k3d.io
Example Workflow: Create a new cluster and use it with kubectl
k3d cluster create CLUSTER_NAME
to create a new single-node cluster (= 1 container running k3s + 1 loadbalancer container)k3d kubeconfig merge CLUSTER_NAME --switch-context
to update your default kubeconfig and switch the current-context to the new onekubectl get pods --all-namespaces
k3d cluster delete CLUSTER_NAME
to delete the default cluster#kubernetes #docker #devops