Skip to content

๐Ÿงธ Smol K8s Lab

Leverage Argo CD and slim Kubernetes distributions, like K3s, to create production-like environments via a declarative workflow. Batteries and ๐Ÿฆ‘ included.

About

smol-k8s-lab's declarative workflow, CLI, and TUI enable rapid iteration in production-like environments with minimal costs for failure. This makes it ideal for proof-of-concepts, prototyping, and benchmarking Kubernetes applications and distributions. It's also great for home labs, with some common FOSS apps such as Home Assistant, Nextcloud, Matrix, and more!

By default, smol-k8s-lab deploys Argo CD + Argo CD Appset Secret Plugin which enables Argo CD to securely manage your lab via files in open source Git repos. Additionally, a customized nord-like dark-theme is provided for Argo CD's incredibly useful web-interface.

Consider viewing our very long walk through if you like video walk-throughs (which is a little out of date, but we intend to update it as soon as possible to include new features):

Here's the same video with captions.

Features

  • Deploys Argo CD by default, so you can manage your entire lab using files in open source git repos
  • Argo CD ships with a dashboard with a custom theme ๐Ÿ’™
  • Specializes in using Bitwarden (though not required) to store sensitive values both in your Bitwwarden vault, and on your cluster as Secrets.
  • Manages all your authentication needs centrally using Zitadel and Vouch ๐Ÿ’ช
  • Supports initialization on a range of common self-hosted apps ๐Ÿ“ฑ
  • featured initialized apps such as Zitadel, Nextcloud, Matrix, and Home Assistant include [b]backups and restores[/b]!
  • Lots o' docs

Getting Started

Please see our Getting Started guide.

Under the hood

Note: this project is not officially affiliated with any of the below tooling or applications. We just love open source projects ๐Ÿ’™

Supported k8s distributions

We always install the latest version of Kubernetes that is available from the distro's startup script.

Distro Description

k3s
The certified Kubernetes distribution built for IoT & Edge computing

k3d
K3d is k3s in Docker ๐Ÿณ.
In beta!

KinD
kind is a tool for running local Kubernetes clusters using Docker container โ€œnodesโ€. kind was primarily designed for testing Kubernetes itself.

We tend to test first on k3s first, then the other distros.

Default Installed Applications

Version is the helm chart version, or manifest version. See the Default Applications tab for more info on each application.

Application Description Initialization Supported
metallb logo, blue arrow pointing up, with small line on one leg of arrow to show balance
metallb
Loadbalancer and IP Address pool manager for metal โœ…
nginx logo, white letter N with green background
ingress-nginx
The ingress-nginx controller allows access to the cluster remotely, needed for web traffic โŒ
cert manager logo
cert-manager
For SSL/TLS certificates โœ…
argo CD logo, an organer squid wearing a fishbowl helmet
Argo CD
Gitops - Continuous Deployment โœ…
argo CD logo, an organer squid wearing a fishbowl helmet
Argo CD Appset Secret Plugin
Gitops - Continuous Deployment โœ…
ESO logo, outline of robot with astricks in a screen in it's belly
ESO
external-secrets-operator integrates external secret management systems like Bitwarden or GitLab โŒ
ESO logo, again
Bitwarden ESO Provider
Bitwarden external-secrets-operator provider โœ…
Zitadel logo, an orange arrow pointing left
ZITADEL
An identity provider and OIDC provider to provide SSO โœ…
Vouch logo, the letter V in rainbow
Vouch
Vouch proxy allows you to secure web pages that lack authentication e.g. prometheus โœ…
Prometheus logo, a torch
Prometheus Stack
Prometheus monitoring and logging stack using loki/promtail, alert manager, and grafana โœ…

Minor Notes:

All Default Applications can be disabled through your ~/.config/smol-k8s-lab/config.yaml file, except Argo CD. You can still choose not to install it, but if not installed, smol-k8s-lab will only install: metallb, nginx-ingress, and cert-manager

Optionally Installed Applications

Application/Tool Description Initialization Supported
cilium logo
Ciliumdemo
Kubernetes netflow visualizer and policy editor โœ…
home assistant logo, which is a small blue house with three white tracers inside of it, making it appear as though the home is a circuit board
Home Assistant
Home Assistant, a self hosted, at home IoT management solution. โœ…
kyvero logo
Kyvernoalpha
Kubernetes native policy management to enforce policies on k8s resources โŒ
kepler logo
kepler
Kepler (Kubernetes Efficient Power Level Exporter) uses eBPF to probe energy-related system stats and exports them as Prometheus metrics. โœ…
k8up logo, a minimalist logo of a small blue hill with line starting the right going into the hill
k8up
Backups operator using restic to backup to s3 endpoints โœ…
k8tz logo, the k8s logo but with a watch in the center instead of the ship wheel
k8tz
Timezone environment variable injector for pods and cronjobs โœ…
netmaker logo, a purple letter N
Netmaker
Netmaker is a self hosted vpn management tool that uses Wiregaurdยฎ โœ…
nextcloud logo, 3 white circles touching eachother on a blue background
Nextcloud
Nextcloud is a self hosted file server โœ…
Mastodon logo, a white M in a purple chat bubble
Mastodon
Mastodon is a self hosted federated social media network โœ…
Matrix logo
matrix
Matrix is a self hosted chat platform โœ…
minio logo, a minimalist drawing in red of a crane
minio
Self hosted S3 Object Store operator โœ…
seaweedfs logo,
seaweedfs
Self hosted S3 Object Store โœ…
k9s logo, outline of dog with ship wheels for eyesk9s Terminal based dashboard for kubernetes โœ…

Status

smol-k8s-lab is actively maintained, and in a semi-stable state. We still may introduce features that, upon major version releases, can introduce breaking changes, but we'll always include how to update your config files in the merged pull request description, and that will be linked in the release notes.

Development

smol-k8s-lab is written in Python 3.12 and built and published using Poetry. You can check out the pyproject.toml for the versions of each library we install below.

Core libraries

These are installed anytime you install smol-k8s-lab as an end user:

Default Library Description
bcrypt to pass a password to argocd and automatically update your Bitwarden
click handles arguments for the CLI
kubernetes for using the partially functional python sdk for kubernetes
minio for connecting to s3 and saving credentials
pyfiglet uses figlet to print the ascii text banner in the tui
pyjwt used for processing tokens from zitadel
pyyaml this is actively being removed in favor of ruamel.yaml
rich makes all the pretty formatted text in logs and --help
textual this is the framework used for writing the TUI
ruamel.yaml to handle the k8s yamls and configs while maintaining comments)
xdg-base-dirs lets us use default config and cache directories for storage accross major OSes

Development libraries

These are installed anytime you want to develop smol-k8s-lab:

Development Library Description
mkdocs-material for the docs site
mkdocs-video for videos on the docs site
deptry for purging unused libraries
textual-dev for consoling textual
pytest-textual-snapshot for taking screenshots with textual
poethepoet for running special tasks during poetry build
coqui-tts for generating text to speech audio files
pydub for converting audio files from wav to mp3, requires ffmpeg
pygame for playing audio accross different OSes, requires alsa on linux

We also utilize the Bitwarden cli, for a password manager so you never have to see/know your Argo CD password.

Things we don't handle (yet)

  1. Port Forwarding

    If you want to access an app outside of port forwarding to test, you'll need to make sure your app's ingress is setup correctly and then you'll need to setup your router to port forward 80->80 and 443->443 for your WAN. Then, setup DNS for your domain if you want the wider internet to access this remotely.

  2. High-Availability

    HA cluster design with K3s requires etcd or another external key-value store such as PostgreSQL. Smol-K8s-Lab deploys k3s in a single-node configuration using SQLite which can be used for multi-node configurations but is not suitable for high-availability.