Go to file
2021-10-27 15:52:37 +02:00
.github docs: use mike and gh actions for versioned k3d.io (#731) 2021-09-08 14:48:07 +02:00
cmd refactor: move from io/ioutil to io and os package (#827) 2021-10-27 15:52:37 +02:00
docgen [Docs] v5 update (#740) 2021-09-17 20:41:57 +02:00
docs [Docs] Clarify node create help text about cluster reference (#808) 2021-10-22 09:08:57 +02:00
pkg refactor: move from io/ioutil to io and os package (#827) 2021-10-27 15:52:37 +02:00
proxy [Docs] v5 update (#740) 2021-09-17 20:41:57 +02:00
tests [Enhancement] Edit CoreDNS ConfigMap on disk for more reliability (#814) 2021-10-22 15:07:01 +02:00
tools tools: use older alpine base image while building to avoid execution issues with make caused by https://wiki.alpinelinux.org/wiki/Release_Notes_for_Alpine_3.14.0#faccessat2 (in DroneCI) 2021-09-30 15:30:46 +02:00
vendor update to go1.17 and update direct dependencies 2021-09-07 08:57:05 +02:00
version [Cleanup] Types, ready-log-messages & closing connections (#818) 2021-10-27 12:56:04 +02:00
.all-contributorsrc docs: add benjaminjb as a contributor for code (#776) 2021-10-08 11:47:28 +02:00
.dockerignore add .dockerignore to ignore submodules when building k3d 2020-06-10 19:46:19 +02:00
.drone.yml Merge branch 'main' into main-v5 2021-09-08 19:07:27 +02:00
.gitignore remove accidentally added pipenv files 2021-05-26 12:05:15 +02:00
.golangci.yml [FEATURE/FIX] Viper Configuration and JSON Schema (#472) 2021-02-03 11:31:21 +01:00
CHANGELOG.md v5.0.1: changelog 2021-10-13 21:11:38 +02:00
CODE_OF_CONDUCT.md misc: add contributing guide, CoC and all-contributors 2020-10-06 16:37:45 +02:00
CONTRIBUTING.md [Enhancement] docs: add a project overview (#680) 2021-07-20 15:44:29 +02:00
deploy-aur.sh [Enhancement] CI/CD: AUR Deploy Script (#391, thanks @JohnnyCrazy) 2020-11-03 19:07:02 +01:00
dind-manifest.tmpl manifests: ensure that dind image has - separator 2021-08-30 12:34:11 +02:00
Dockerfile update to go1.17 and update direct dependencies 2021-09-07 08:57:05 +02:00
go.mod migrate to module rancher/k3d/v5 2021-09-07 08:58:57 +02:00
go.sum update to go1.17 and update direct dependencies 2021-09-07 08:57:05 +02:00
install.sh Add darwin-arm64 to supported archs (#676) 2021-07-17 08:37:46 +02:00
LICENSE overall/license: update to year range -2021 2021-05-21 13:07:59 +02:00
main.go migrate to module rancher/k3d/v5 2021-09-07 08:58:57 +02:00
Makefile migrate to module rancher/k3d/v5 2021-09-07 08:58:57 +02:00
manifest.tmpl manifests: strip v prefix from semver 2021-08-18 19:31:57 +02:00
mkdocs.yml [Docs] v5 update (#740) 2021-09-17 20:41:57 +02:00
README.md docs: add benjaminjb as a contributor for code (#776) 2021-10-08 11:47:28 +02:00

k3d

Build Status License Downloads

Go Module Go version Go Report Card

All Contributors

Contributor Covenant

Please Note: main is now v5.0.0 and the code for v4.x can be found in the main-v4 branch!

k3s in docker

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.

asciicast

Learning

Requirements

Releases

Note: In May 2020 we upgraded from v1.7.x to v3.0.0 after a complete rewrite of k3d!
Note: In January 2021 we upgraded from v3.x.x to v4.0.0 which includes some breaking changes!
Note: In September 2021 we upgraded from v4.4.8 to v5.0.0 which includes some breaking changes!

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 -
Chocolatey stable chocolatey -

Get

You have several options there:

  • use the install script to grab the latest release:

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

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

  • install via MacPorts: sudo port selfupdate && sudo port install k3d (MacPorts is available for MacOS)

  • 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: go install github.com/rancher/k3d@latest (Note: this will give you unreleased/bleeding-edge changes)

  • use Chocolatey: choco install k3d (Chocolatey package manager is available for Windows)

or...

Build

  1. Clone this repo, e.g. via git clone git@github.com:rancher/k3d.git or go get github.com/rancher/k3d/v5@main
  2. Inside the repo run
    • 'make install-tools' to make sure required go packages are installed
  3. Inside the repo run one of the following commands
    • make build to build for your current system
    • go install to install it to your GOPATH (Note: this will give you unreleased/bleeding-edge changes)
    • make build-cross to build for all systems

Usage

Check 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

  1. k3d cluster create CLUSTER_NAME to create a new single-node cluster (= 1 container running k3s + 1 loadbalancer container)
  2. [Optional, included in cluster create] k3d kubeconfig merge CLUSTER_NAME --kubeconfig-switch-context to update your default kubeconfig and switch the current-context to the new one
  3. execute some commands like kubectl get pods --all-namespaces
  4. k3d cluster delete CLUSTER_NAME to delete the default cluster

Connect

  1. Join the Rancher community on slack via slack.rancher.io
  2. Go to rancher-users.slack.com and join our channel #k3d
  3. Start chatting

History

This repository is based on @zeerorg's zeerorg/k3s-in-docker, reimplemented in Go by @iwilltry42 in iwilltry42/k3d, which got adopted by Rancher inrancher/k3d.

  • k3x: GUI (Linux) to k3d
  • vscode-k3d: vscode plugin for k3d
  • AbsaOSS/k3d-action: fully customizable GitHub Action to run lightweight Kubernetes clusters.
  • AutoK3s: a lightweight tool to help run K3s everywhere including k3d provider.
  • nolar/setup-k3d-k3s: setup K3d/K3s for GitHub Actions.

Contributing

k3d is a community-driven project and so we welcome contributions of any form, be it code, logic, documentation, examples, requests, bug reports, ideas or anything else that pushes this project forward.

Please read our Contributing Guidelines and the related Code of Conduct.

You can find an overview of the k3d project (e.g. explanations and a repository guide) in the documentation: k3d.io/internals/project

Contributor Covenant

Contributors

Thanks goes to these wonderful people (emoji key):


Thorsten Klein

💻 📖 🤔 🚧

Rishabh Gupta

🤔 💻

Louis Tournayre

📖

Lionel Nicolas

💻

Toon Sevrin

💻

Dennis Hoppe

📖 💡

Jonas Dellinger

🚇

markrexwinkel

📖

Alvaro

💻 🤔 🔌

Nuno do Carmo

🖋 💬

Erwin Kersten

📖

Alex Sears

📖

Mateusz Urbanek

💻

Benjamin Blattberg

💻

This project follows the all-contributors specification. Contributions of any kind welcome!