Skip to main content

bootstrap simple projects on kubernetes with kind and k3s

Project description

smol k8s lab 🧸 Now with more :squid:

A tool to run slimmer k8s distros on metal, with batteries included. Deploys Argo CD by default, so you can mange your entire local testing lab from the very beginning using files in open source git repos, and with the help of a very handy dashboard.

Also helpful for benchmarking various k8s distros! 💙

Output of smol-k8s-lab --help after cloning the directory and installing the prerequisites.

Getting Started

Installation

smol-k8s-lab requires Python 3.11. If you've already got it and [brew] installed, you should be able to:

# install the CLI
pip3.11 install smol-k8s-lab

# Check the help menu before proceeding
smol-k8s-lab --help

Configuration

We've got a Quickstart guide for you to jump right in :)

Sneak peak... You can create any application you already have in Argo CD by following a simple application schema like this:

apps:
  # name of application to create in Argo CD
  cert_manager:
    # if set to false, we ignore this app
    enabled: true
    argo:
      # secret keys to pass to Argo CD Application Set Generator
      secret_keys:
        # Used for letsencrypt-staging, to generate certs
        email: ""
      # If set to "", we'll instead use the repo, path, ref, namespace, and project_source_repos
      # else we'll skip installing this app b/c its part of another app of apps with this name.
      part_of_app_of_apps: ""
      # git repo to install the Argo CD app from
      repo: "https://github.com/small-hack/argocd-apps"
      # path in the argo repo to point to. Trailing slash very important!
      path: "ingress/cert-manager/"
      # either the branch or tag to point at in the argo repo above
      ref: "main"
      # namespace to install the k8s app in
      namespace: "ingress"
      # source repos for cert-manager CD App Project (in addition to argo.repo)
      project_source_repos:
        - https://charts.jetstack.io

Under the hood

Note: this project is not officially afilliated with any of the below tooling or applications.

Supported k8s distributions

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

Distro Description

k0s
Simple, Solid & Certified Kubernetes Distribution

k3s
The certified Kubernetes distribution built for IoT & Edge computing

k3d
ALPHA - TESTING PHASE k3s in docker 🐳

KinD
kind is a tool for running local Kubernetes clusters using Docker container “nodes”. kind was primarily designed for testing Kubernetes itself, but may be used for local development or CI.

We tend to test first on k3s first, then the other distros. k3d support coming soon.

Default Installed Applications

Version is the helm chart version, or manifest version.

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 Yes
nginx logo, white letter N with green background
nginx-ingress
The ingress controller allows access to the cluster remotely, needed for web traffic No
cert manager logo
cert-manager
For SSL/TLS certificates Yes
argo CD logo, an organer squid wearing a fishbowl helmet
Argo CD
Gitops - Continuous Deployment Yes
[argo CD logo, an organer squid wearing a fishbowl helmet][Argo CD Appset Secret Plugin]
[Argo CD Appset Secret Plugin]
Gitops - Continuous Deployment Yes
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 No
Bitwarden logo,
Bitwarden ESO Provider
Bitwarden external-secrets-operator provider Yes
Zitadel logo, an orange arrow pointing left
Zitadel
An identity provider and OIDC provider to provide SSO Yes
Vouch logo, the letter V in rainbow
Vouch
Vouch proxy allows you to secure web pages that lack authentication e.g. prometheus Yes
Prometheus logo, a torch
Prometheus Stack
Prometheus monitoring and logging stack using [loki]/[promtail], [alert manager], and [grafana] Yes

Minor Notes All Default Applications can be disabled through your ~/.config/smol-k8s-lab/config.yaml file, except: 1. nginx-ingress is the currently the only supported ingress-controller. traefik support is being worked on. 2. Argo CD is optional, but if not installed, smol-k8s-lab will only install: metallb, nginx-ingress, and cert-manager

None of these applications are supported or endorsed by their companies/organizations. These are all community maintained Argo CD Application manifests.

Optionally Installed Applications

Application/Tool Description Initialization Supported
cilium logo
Ciliumalpha
latest Kubernetes netflow visualizer and policy editor
kyvero logo
Kyvernoalpha
latest Kubernetes native policy management to enforce policies on k8s resources
keycloak logo
KeyCloakalpha
Self hosted IAM/Oauth2 solution Yes
kepler logo
kepler
Kepler (Kubernetes Efficient Power Level Exporter) uses eBPF to probe energy-related system stats and exports them as Prometheus metrics. Yes
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 Yes
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 Yes
nextcloud logo, 3 white circles touching eachother on a blue background
Nextcloud
Nextcloud is a self hosted file server Yes
Mastodon logo, a white M in a purple chat bubble
Mastodon
Mastodon is a self hosted federated social media network Yes
[Matrix logo][matrix]
[matrix]
Matrix is a self hosted chat platform Yes
minio logo, a minimalist drawing in red of a crane
minio
Self hosted S3 Object Store operator Yes
k9s logo, outline of dog with ship wheels for eyes
k9s
Terminal based dashboard for kubernetes

Troubleshooting

If you're stuck, checkout the Notes to see if we also got stuck on the same thing at some point :) Under each kubernetes distro or application, we'll have notes on how to learn more about it, as well as any errors we've already battled.

Status

This is still in later alpha, as we figure out all the apps and distros we want to support, and pin all the versions, but if you'd like to contribute or just found a :bug:, feel free to open an issue (or pull request), and we'll take a look! We'll try to get back to you asap!

Development

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

  • rich (this is what makes all the pretty formatted text)
  • PyYAML (to handle the k8s yamls and configs)
  • bcrypt (to pass a password to argocd and automatically update your Bitwarden)
  • click (handles arguments for the CLI)

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

And more!

Want to get started with argocd? If you've installed it via smol-k8s-lab, then you can jump here. Otherwise, if you want to start from scratch, start here

Project details


Release history Release notifications | RSS feed

This version

1.0.0

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

smol_k8s_lab-1.0.0.tar.gz (69.6 kB view hashes)

Uploaded Source

Built Distribution

smol_k8s_lab-1.0.0-py3-none-any.whl (85.6 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page