kubernetes: reimplement client config as portable user module (#35) #39
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "issue-35-kubernetes-client-user-module"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Rewrites
users/modules/kubernetes.nixas a clean, portable home-manager user module with akubernetes.client.*namespace (fixes #35).Behavior
kubernetes.client.enableinstalls the tools only (kubectl,kubernetes-helm,kubelogin, plusextraPackages) and leaves~/.kube/configcompletely untouched — no config is written until a cluster CA is actually configured.kubeconfig.enablerenders~/.kube/configviahome.file; it auto-enables only oncecaFile/caData/clientCertificateFile/insecureSkipTlsVerifyis set, and an explicitkubeconfig.enable = truewithout any CA source fails a module assertion, so the unsafeinsecure-skip-tls-verify: truedefault from the old module can never return silently.oidc.*) generates the kubeloginexecblock (device-code flow by default,OIDC_ISSUER_URL/OIDC_CLIENT_IDenv,${env:HOME}/.cache/kubelogincache path — expanded by client-go, not a shell).users/users/rpickler.nixis rewired to the new namespace with the Authentik issuer; the kubeconfig stays dormant until a sops-managedcaFileis added.Verified — evaluated against this repo's pinned flake inputs (nixpkgs + home-manager 26.05) with a harness covering:
home.file.".kube/config", tools on PATH — PASScaData+ OIDC → CA embedded, kubelogin exec block,forcetakeover,chmod 600onChange hook,extraPackagesmerged — PASSkubeconfig.enablewith no CA → assertion rejects — PASSNotes: hm 26.05 dropped
home.file.<name>.mode/per-filetarget, so permissions are tightened by the activationonChangehook; prefercaFile/clientKeyFilepaths over the*Dataoptions to keep secret material out of the Nix store.Duplicate implementation. Closing in favor of the other one.
Pull request closed