farcaller/nixhelm

Insert Charts directly in K3S

Svenum opened this issue · 3 comments

Hello,

maybe I am dump but I dont understand how to pass these charts directly into my K3S Cluster built on NixOS. Or is this even possible with this Flake? Maybe I dont understand the purpose of this flake right.

Thats how I build the cluster:

{ ... }:
{
  services.k3s = {
    enable = true;
    tokenFile = /path/to/sops-nix/token;
    extraFlags = "--clusterCIDR 10.11.0.0/16";
    clusterInit = true;
  
    # and on Node 2 und 3
    serverAddress = "https://10.10.0.1:6443" # IP from the first Node
  };
}

The k3s helm integration expects you to point at the chart repo directly, so I don't think there's any feasible way to use this repo with it. This repo is mostly useful for tooling like argocd, or even applying the redered charts directly with kubectl apply in your activation script.

Ok, I understand. But do you know a way to fully manage the Kube Cluster with nix? All I found was maybe this: https://github.com/gytis-ivaskevicius/nix-helm.
But this only creates a shell script to apply the changes to the cluster if I understand it correctly.

There's no real way to fully manage a k8s cluster from nix because it's tricky to make sure there are no outside changes. Otherwise, you can e.g. just dump your yamls into /var/lib/rancher/k3s/server/manifests with an activation script and let k3s reapply them. That's pretty close to managing it with nix, but it's not much practical.