A minimal, layered Linux distribution designed for running Kubernetes clusters in virtual environments. Built using Docker multi-stage builds to create reproducible, lightweight system images.
This project provides a complete, bootable Linux system optimized for Kubernetes workloads. It uses a layered architecture where each component is built independently and combined to create a Live CD/ISO that boots into a functional Kubernetes-ready environment.
The system is composed of five main layers:
Builds a custom Linux kernel optimized for containerization and Kubernetes.
Purpose:
- Provides a minimal kernel with only required features enabled
- Includes support for namespaces, cgroups v2, overlay filesystems, and container networking
- Configured for QEMU/KVM virtualization with VirtIO drivers
Key Features:
- Container runtime support (namespaces, cgroups, seccomp, AppArmor)
- Network filtering (netfilter, nftables, iptables)
- Block device and filesystem support (overlay, squashfs, ext4, ISO9660)
- Initrd support for Live CD boot
- Bridge networking and VETH devices for container networking
Files:
vanilla.Dockerfile- Builds kernel from upstream source with custom configurationdistro.Dockerfile- Alternative: extracts kernel from Debian distribution
Output: kernel/out/vmlinuz (compressed kernel image)
Creates a minimal Debian-based root filesystem with systemd.
Purpose:
- Provides the base operating system with essential utilities
- Includes systemd for service management
- Sets up networking, SSH access, and system administration tools
Key Components:
- systemd with networkd, resolved, and timesyncd
- Cloud-init for initial configuration
- OpenSSH server for remote access
- Network tools: iproute2, iptables, nftables
- System utilities: bash, coreutils, htop, mc, nano
Configuration:
- Hostname:
k8s-livecd - Root password:
root - Networkd configured for DHCP
- Resolved for DNS management
- Persistent journald logging
Output:
rootfs/out/rootfs.tar.gz(tarball)rootfs/out/rootfs.qcow2(disk image for testing)
Extends the base rootfs with Kubernetes components and container runtime.
Purpose:
- Adds Kubernetes control plane and worker node binaries
- Installs containerd as the container runtime
- Includes container management tools
Components:
- Kubernetes: kubelet, kubeadm, kubectl
- Container Runtime: containerd, runc
- Container Tools: crictl, nerdctl
- Networking: CNI plugins for container networking
Systemd Services:
containerd.service- Container runtime daemonkubelet.service- Kubernetes node agentpreload-k8s-images.service- Pre-loads container images
Output:
rootfs-k8s/out/rootfs-k8s.tar.gz(tarball)rootfs-k8s/out/rootfs-k8s.qcow2(disk image)
Packages everything into a bootable ISO image with an overlay filesystem.
Purpose:
- Creates a bootable Live CD/ISO
- Implements an overlay filesystem for persistent storage
- Provides custom init system for boot process
Architecture:
- Lower layer: Read-only squashfs containing the root filesystem
- Upper layer: Read-write ext4 partition for changes
- Overlay: Combines both layers using OverlayFS
Boot Process (livecd/files/init):
- Mount proc, sys, and devtmpfs
- Locate and mount the Live CD (ISO) containing squashfs
- Mount squashfs as read-only lower layer
- Find available writable device and format as ext4 if needed
- Create upper and work directories on writable device
- Mount overlay filesystem combining lower and upper layers
- Switch root and start systemd
GRUB Configuration:
- Boots with kernel and custom initrd
- Console output on serial (ttyS0) and VGA
- Passes kernel parameters for systemd and cgroup v2
Output:
livecd/out/node.iso- Bootable ISO imagelivecd/out/initrd.img- Initial ramdisk with custom init
Provides cloud-init configuration for automated system setup.
Purpose:
- Automates initial system configuration
- Configures networking, users, and services on first boot
- Uses NoCloud datasource (no cloud provider required)
Components:
user-data- Cloud-init user data configurationmeta-data- Instance metadatanetwork-config- Network configuration
Output: cloudinit/cloud-init-seed.iso - NoCloud seed ISO with label cidata
Run the main build script to create all layers:
./build.shThis script:
- Builds the kernel from source
- Creates the base rootfs
- Adds Kubernetes components
- Packages everything into a Live CD ISO
- Generates cloud-init configuration ISO
Kubernetes and container runtime versions can be customized via build arguments in build.sh:
KUBELET_URL,KUBEADM_URL,KUBECTL_URL- Kubernetes binariesCONTAINERD_TGZ_URL- containerd releaseRUNC_URL- runc binaryCRICTL_TGZ_URL- CRI toolsNERDCTL_TGZ_URL- nerdctl (containerd CLI)CNI_PLUGINS_TGZ_URL- CNI networking plugins
Start the VM with QEMU/KVM:
./run.shThis launches a VM with:
- KVM acceleration
- 2GB RAM, all CPU cores
- Serial console (nographic)
- Network with SSH port forwarding (host:2222 → guest:22)
- Live CD ISO as bootable media
- Cloud-init seed ISO for configuration
- Persistent storage disk (
var.qcow2)
SSH into the running VM:
ssh -p 2222 root@localhostDefault password: root
- Kubernetes Development: Test Kubernetes features in isolated VMs
- Cluster API: Base image for Cluster API providers
- CI/CD: Ephemeral test environments
- Learning: Understand Linux boot process and containerization
- Immutable Infrastructure: Read-only base with overlay for changes
/- OverlayFS (lower: squashfs from ISO, upper: ext4 on var.qcow2)/mnt- Mount point for the writable upper layer device- Persistent data stored on the upper layer survives reboots
The kernel is built with minimal configuration including:
- No loadable modules support (all drivers built-in)
- Container features: namespaces, cgroups v2, seccomp
- VirtIO drivers for QEMU performance
- Networking: bridge, veth, netfilter, nftables
- Filesystems: ext4, overlay, squashfs, ISO9660
Key systemd services configured:
systemd-networkd- Network management (DHCP)systemd-resolved- DNS resolutionsystemd-timesyncd- Time synchronizationcontainerd- Container runtimekubelet- Kubernetes node agentcloud-init- Initial configuration
- Docker (for building)
- QEMU/KVM (for running)
- xorriso or genisoimage (for ISO creation)
- Sufficient disk space (~5GB for build artifacts)
This project is a collection of open-source components. Refer to individual component licenses for details.