liveBook · Manning

K3d

As explained in Learn Docker in a Month of Lunches, Second Edition

k3d is a lightweight command-line tool for running k3s Kubernetes clusters inside Docker containers.

k3d is a lightweight way to create temporary Kubernetes test environments by running k3s nodes inside Docker containers. It fits naturally into a CI/CD workflow when a deployment should be checked against the Kubernetes API before production. section 16.4

A k3d test cluster can help verify:

  • Whether release images deploy without errors. section 16.4
  • Whether Pods distribute correctly across multiple nodes. section 16.4
  • Whether application components communicate correctly inside Kubernetes. section 16.4

Create a CI test cluster

A GitHub Actions workflow can use AbsaOSS/k3d-action@v2 to create a one-node cluster named ch16, disable the load balancer and selected default services, then select it with kubectl config use-context k3d-ch16.

How Learn Docker in a Month of Lunches, Second Edition covers it

How deep it goes
Explains containerized nodes, multi-node testing, and workflow integration, but defers local installation and detailed argument meanings.
Examples
Demonstrates a one-node ch16 cluster created by GitHub Actions and selected through the k3d-ch16 kubectl context.
What it assumes
Assumes a Kubernetes deployment model, release images, and familiarity with GitHub Actions, kubectl, and Helm.
What you can do after
Operate/configure a temporary Kubernetes test cluster through a GitHub Action and kubectl.
How it connects
Connects Kubernetes, k3s, Docker, GitHub Actions, kubectl, Helm, and Pods.

Also explained in

Compare how 3 books explain k3d →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Learn Docker in a Month of Lunches, Second Edition. The section links point to the parts of the book it draws on.