Little helper to run CNCF's k3s in Docker
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
k3d/docs/index.md

4.0 KiB

rancher/k3d

k3d is a lightweight wrapper to run k3s (Rancher Lab's minimal Kubernetes distribution) in docker.

k3d makes it very easy to create single- and multi-node k3s clusters in docker, e.g. for local development on Kubernetes.

??? Tip "View a quick demo"

Learning

Requirements

Releases

Platform Stage Version Release Date
GitHub Releases stable GitHub release (latest by date) GitHub Release Date
GitHub Releases latest GitHub release (latest by date including pre-releases) GitHub (Pre-)Release Date
Homebrew - homebrew -

Installation

You have several options there:

  • use the install script to grab the latest release:

    • wget: #!bash wget -q -O - https://raw.githubusercontent.com/rancher/k3d/master/install.sh | bash
    • curl: #!bash curl -s https://raw.githubusercontent.com/rancher/k3d/master/install.sh | bash
  • use the install script to grab a specific release (via TAG environment variable):

    • wget: #!bash wget -q -O - https://raw.githubusercontent.com/rancher/k3d/master/install.sh | TAG=v3.0.0-beta.0 bash
    • curl: #!bash curl -s https://raw.githubusercontent.com/rancher/k3d/master/install.sh | TAG=v3.0.0-beta.0 bash
  • use Homebrew: #!bash brew install k3d (Homebrew is available for MacOS and Linux)

  • install via AUR package rancher-k3d-bin: yay -S rancher-k3d-bin

  • grab a release from the release tab and install it yourself.

  • install via go: #!bash go install github.com/rancher/k3d (Note: this will give you unreleased/bleeding-edge changes)

Quick Start

Create a cluster named mycluster with just a single master node:

k3d create cluster mycluster

Get the new cluster's connection details merged into your default kubeconfig (usually specified using the KUBECONFIG environment variable or the default path #!bash $HOME/.kube/config) and directly switch to the new context:

k3d get kubeconfig mycluster --switch

Use the new cluster with kubectl, e.g.:

kubectl get nodes