No description
Find a file
2025-12-07 19:08:56 +01:00
docs Purge Longhorn 2025-05-29 12:37:50 +02:00
modules Shrink metallb IP address pool 2025-12-07 19:08:56 +01:00
nixng-configurations Move deluge to nixos container 2025-11-14 22:13:36 +01:00
nixng-modules Move deluge to nixos container 2025-11-14 22:13:36 +01:00
scripts added config lines to Inbucket and bugjes opgelost in deployment scripts 2025-02-16 15:15:56 +01:00
.envrc Add formatting pre-commit hook 2024-10-28 16:08:07 +01:00
.gitignore Allow creating local GC roots for manifests 2025-01-25 23:42:41 +01:00
.sops.yaml Init 2024-09-07 12:35:02 +02:00
applyset-deploy.sh Move to new house 2025-04-30 22:29:13 +02:00
deployments.nix Migrate kitchenowl to podman container 2025-11-27 20:05:50 +01:00
flake.lock Move radarr to nixos container 2025-11-10 20:47:53 +01:00
flake.nix Move radarr to nixos container 2025-11-10 20:47:53 +01:00
formatter.nix Update git-hooks 2024-10-30 21:19:13 +01:00
globals.nix Migrate kitchenowl to podman container 2025-11-27 20:05:50 +01:00
kubenix.nix Move blog to nixos container 2025-10-25 19:09:09 +02:00
README.md Migrate kitchenowl to podman container 2025-11-27 20:05:50 +01:00
secrets.yml Migrate kitchenowl to podman container 2025-11-27 20:05:50 +01:00
shell.nix Add formatting pre-commit hook 2024-10-28 16:08:07 +01:00
treefmt.nix Add formatter 2024-10-28 16:03:01 +01:00
utils.nix Build all images with nix-snapshotter 2024-12-19 21:07:30 +01:00

Kubernetes deployments

We use Kubenix to write Kubernetes deployments in Nix!

Acknowledgements

  • flake-utils: Handy utilities to develop Nix flakes
  • kubenix: Declare and deploy Kubernetes resources using Nix
  • nixhelm: Nix-digestible Helm charts
  • sops-nix: Sops secret management for Nix

Prerequisites

To deploy to the Kubernetes cluster, first make sure you have an admin account on the cluster. You can generate this using nix run '.#gen-k3s-cert' <username> <servername> ~/.kube, assuming you have SSH access to the master node. This puts a private key, signed certificate and a kubeconfig in the kubeconfig directory

Bootstrapping

We are now ready to deploy to the Kubernetes cluster. Deployments are done through an experimental Kubernetes feature called ApplySets. Each applyset is responsible for a set number of resources within a namespace.

If the cluster has not been initialized yet, we must bootstrap it first. Run these deployments:

  • nix run '.#bootstrap-default-deploy'
  • nix run '.#bootstrap-kube-system-deploy'

Deployment

Now the cluster has been initialized and we can deploy applications. To explore which applications we can deploy, run nix flake show. Then, for each application, run nix run '.#<application>-deploy'. Or, if you're lazy: nix flake show --json | jq -r '.packages."x86_64-linux"|keys[]' | grep -- -deploy | xargs -I{} nix run ".#{}".