Rewrite kubernetes client config as user module #35
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
@hermes-bot In order to make it portable with my work system, I would like the kubernetes client config re-implemented as a user module.
Rewritten as a portable user module — PR #39 (
issue-35-kubernetes-client-user-module).Summary of the new
users/modules/kubernetes.nix:kubernetes.client.enable= tools only (kubectl,helm,kubelogin,extraPackages);~/.kube/configis not touched until a cluster CA is configured.kubernetes.client.kubeconfig.enablerenders~/.kube/config(takes over an existing file viaforce,chmod 600after activation). It auto-enables only oncecaFile/caData/clientCertificateFile/insecureSkipTlsVerifyis set, and an explicit enable without any CA source now fails a module assertion — the old module's silentinsecure-skip-tls-verify: truefallback can't return.kubernetes.client.oidc.*generates the kubelogin exec credential plugin (device-code flow, Authentik issuer viaOIDC_ISSUER_URL/OIDC_CLIENT_ID,${env:HOME}/.cache/kubelogincache path expanded by client-go).users/users/rpickler.nixswitched to the new namespace (kubernetes.client = { enable = true; server = "https://lurch.lan:6443"; oidc = {...}; }); kubeconfig stays dormant until you add e.g.caFile = "/run/secrets/…/kube-ca.pem".Verified by evaluating against this repo's pinned nixpkgs/home-manager 26.05 inputs: tools-only mode leaves
home.file.".kube/config"undeclared; full config renders CA data + kubelogin exec + k9s fromextraPackages; missing-CA enable is rejected; and rpickler's complete home-manager module list (nixvim, hyprland, sops, …) still evaluates with the config dormant.Note: home-manager 26.05 removed
home.file.<name>.mode, hence the activation-hook chmod. PrefercaFile/clientKeyFilepaths overcaData/clientKeyDataso secret material stays out of the Nix store.