What kind of certificate is even needed? I’m really new to that kind of stuff. Though I expected that enabling easyCert would deal with that stuff for me…
Not direcly addressing your concern, but — if you can — you might try to use k3s it has good UX — generally speaking. We are on a similar journey at this moment, so in the days / weeks to come we might exchange eurekas and caveats (k3s bound).
Well hidden in a github issue (which I can’t find now) I found that I have to delete some files and that I have to set masterAdress to the hostname, as the cert-deamon seems to not be able to generate a cert for an IP.
Also I learnt that apiserver.advertiseAddress has to be the IP (as I changed it to the hostname as well in first try).
So now the kubernetes is up and running.
Thanks for pointing me to k3s anyway, I might give it a shot.
It would be great if you could share the final Nix config for single node k8s, including some comments about the various challenges you found would be amazing.
It is probably burried in my git history. I dropped the whole setup after a very short time in favor of a k3os VM for the sake of simplicity, which again I dropped another month later, as I changed jobs and k8s didn’t play a role anymore.
Despite having all the expected files in /var/lib/cfssl/ (including ca.pem, ca-key.pem, etc.), the certmgr service fails to start because /etc/certmgr/certmgr.json is missing and isn’t generated automatically by the NixOS modules. The logs show errors like “failed loading spec from /nix/store/…-certmgr” and “failed reading …-certmgr,” and as a result, services like kube-addon-manager don’t start.
I’ve tried cleaning up any old state, running nixos-rebuild switch, and even manually creating the certmgr config, but no luck so far. The cfssl service is running, but attempts to query it over TLS result in “unknown CA” errors, which I assume is because the cert isn’t trusted locally.
Has anyone managed to get this working recently? Is there something special needed to trigger the module to create /etc/certmgr/certmgr.json, or a recommended way to debug/fix certmgr and the Kubernetes PKI setup?
Any advice or recent success stories would be appreciated!