Skip to content

Latest commit

 

History

History
88 lines (70 loc) · 4.48 KB

README.md

File metadata and controls

88 lines (70 loc) · 4.48 KB

Krust

A repository used to create up-to-date images for fully automated operation of Kubernetes (k3s) on Raspberry Pis with configuration using cloud-init.

[WIP]

THIS REPOSITORY IS A WORK-IN-PROGRESS; IMAGES ARE NOT YET PUBLISHED!

Tools

The following tools are installed and available in the image:

Name Documentation
cloud-init Documentation License
cosign Documentation License
crane Documentation License
flux Documentation License
gitops Documentation License
k3s Documentation License
k3s airgap images Documentation License
oras Documentation License

Features

  • support for cloud-init to easily configure the cluster in a reproducible way without requiring image rebuilds
    • automatically bootstrap k3s for cluster, server, or agent
    • automatically bootstrap flux
  • k3s air-gap images are included in the image to avoid image pulls on start
  • kube config is symlinked for every user, including those created by cloud-init
    • this helps ensure that third-party tools that rely on the kube config just work
  • kernel and all linux packages are up-to-date with the latest available as of the time of build
  • kernel is flashed on first start if new kernel is available
    • this will not keep the kernel up to date over time, so re-imaging will be necessary

How it Works

This repository uses packer to download the latest upstream image and repackage it to include additional tooling, including k3s and cloud-init. Packer itself is executed within an OCI container using binfmt and qemu to enable builds on varying source architectures.

To create new images using the containerd runtime via nerdctl:

make

We recommend using colima on macOS to create a suitable containerd runtime:

brew install colima

colima start --runtime=containerd --cpu=4 --memory=16 --disk=64

Notice

The Raspberry Pi may reboot on the first boot from a newly flashed SD card, which is done to upgrade the kernel. This is managed by the 00-upgrade-kernel.cfg which executes the upgrade-kernel script. This script flashes the kernel and creates a marker file used by cloud-init to detect when a reboot is required. On subsequent boots, the script will remove the marker file and the system will start as normal.