Every other nixos-homelab-* repo takes this one as an input and builds
on its cluster module, the facts of the cluster, with a runner that
runs it: the k3s module, enabled. It also
provides shared services used across those repos: a dashboard, TLS, and
SSH-key access to the cluster. Databases and storage are in
nixos-homelab-storage.
See the kubenix docs
for the typed resources and submodules of homelab.kubernetes, and
the documentation, under Options, for the full list of module options.
{
inputs = {
...
homelab-shared = {
url = "github:nixos-homelab/shared";
inputs.nixpkgs.follows = "nixpkgs";
};
...
};
}{ inputs, ... }:
{
imports = [ inputs.homelab-shared.nixosModules.k3s ];
config.homelab.k3s.enable = true;
}- cluster: the shared
homelab.cluster.*options every other module in this ecosystem builds on, whichever runner runs the cluster: IP families, pod/service CIDRs, debug tools, backup aggregation, the images to preload and the manifests to apply, and the facts the runner sets (kubeconfig, unit, Kubernetes version). - k3s: runs the cluster on k3s (
homelab.k3s): it importscluster, preloads its images (each once, so a boot or deploy imports only the images that changed), applies its manifests, removes the manifests a deploy dropped along with their objects, and drains the node at shutdown. - workloads: the settings every workload shares (
homelab.workloads: domain, gateway class, ACME issuer, pod user and group) and kubenix configuration inhomelab.kubernetes, with theworkloadsubmodule -- see the kubenix docs.clusterimports it and hands what it holds to the runner. - homepage: the homepage dashboard, with a
per-service
integrationsallow-list. - cert-manager: cert-manager plus a LibDNS ACME webhook, for automated TLS certificates.
- k8sss: deploys k8sss for
SSH-key-based
kubectlaccess.