Skip to content

feat(kubernetes): kubeconfig:fetch -- one list over lokal/Vault/SOPS, filtered by lab - #14

Merged
patrick-hermann-sva merged 2 commits into
mainfrom
feat/kubeconfig-unified-list
Oct 7, 2026
Merged

patrick-hermann-sva merged 2 commits into
mainfrom
feat/kubeconfig-unified-list

Conversation

@patrick-hermann-sva

@patrick-hermann-sva patrick-hermann-sva commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

task -g kubeconfig:fetch (t kc) without SOURCE no longer asks for the source first. It asks for the lab, then shows one gum list over all sources:

Lab?  alle / labda / labul / -

homerun2-dev2              labul     lokal,vault
infra-sthings              labul     lokal
platform-sthings           labul     lokal
sthings-runner             labda     lokal
labda-machinery            labda     sops
app-dev                    -         vault

Sources

  • lokal: every kubeconfig directly in ~/.kube (no *.bak*, must contain clusters:)
  • Vault/SOPS win over lokal; an existing local file is refreshed in place (labda-sthings-infra.yaml stays .yaml), identical content → unveraendert, no write
  • local-only → prints export KUBECONFIG=…
  • Vault/SOPS down → warning, list without those entries

Lab, first match wins:

  1. ~/.kube/labels (KUBE_LABELS), lines <cluster> <lab>
  2. network of the local kubeconfig's server: (LAB_NETS, default 10.31.=labul 10.100.136.=labda)
  3. Vault custom_metadata.lab on kubeconfigs/<cluster>
  4. name prefix labda- / labul-
  5. otherwise -

LAB=labul skips the lab question; alle shows everything. SOURCE=vault|sops|lokal and CLUSTER= still work non-interactively.

Tested (stubbed gum): lab list, labul filter (11 clusters), alle (27), labels-file override, LAB= without prompt, Vault fetch (homerun2-dev2, app-dev), SOPS fetch (labda-sthings-infra) byte-identical with the local copy, unchanged path, Vault outage, unknown cluster.

🤖 Generated with Claude Code

… SOPS)

Without SOURCE, fetch lists every cluster once -- kubeconfigs already in
~/.kube plus Vault and SOPS entries -- with its sources next to it. Remote
sources win and refresh the existing local file (unchanged files are left
alone); local-only clusters just print the export. A failing source only
drops its entries. SOURCE=lokal added.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Each cluster gets a lab: ~/.kube/labels (<cluster> <lab>), else the
network of the local kubeconfig's server address (LAB_NETS, default
10.31.=labul 10.100.136.=labda), else Vault custom_metadata `lab`,
else the name prefix (labda-/labul-), else `-`. fetch asks for the lab
first (`alle` = everything, LAB=<lab> skips the question) and shows the
lab as a column in the cluster list.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@patrick-hermann-sva patrick-hermann-sva changed the title feat(kubernetes): kubeconfig:fetch picks from one list (lokal, Vault, SOPS) feat(kubernetes): kubeconfig:fetch -- one list over lokal/Vault/SOPS, filtered by lab Oct 7, 2026
@patrick-hermann-sva
patrick-hermann-sva merged commit 6ecb764 into main Oct 7, 2026
1 check passed
@patrick-hermann-sva
patrick-hermann-sva deleted the feat/kubeconfig-unified-list branch October 7, 2026 12:47

This branch was successfully deployed

1 active deployment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant