Skip to content

Draw a bare cluster from a kubeconfig context, on chant's read-only lister #1083

Closed

Description

@lex00

kubectl behold and k9s need behold to draw a cluster from a kubeconfig context with no chant project. Most of the read exists: the lister built for #1029 now lives in chant (INTENTIUS/chant#4532), and behold index kubernetes (#1026) types its output and derives edges. What is missing is drawing that read as behold's graph, and two gaps in the lister's output. This issue builds on it and writes no second reader. Part of #1049, phase 4.

Today

  • chant's packages/core/src/cloud-lister/kubernetes.ts runs API discovery, then a paged LIST per served kind. kubeTargetFromKubeconfig accepts a token, a token file or a client certificate, and refuses a user with exec or auth-provider.
  • indexCloud (packages/core/src/lifecycle/cloud-index.ts) returns the document as a GraphIR in a stamped envelope, typed by the k8s lexicon, with derived edges. A store of kind none keeps nothing.
  • In behold, index versions reach the graph pane only (src/graph-db/sources.ts, src/graph-db/pane.ts), never the drawn graph.
  • From reading the code, not run: the key pattern /secret/i (packages/core/src/sensitive-key.ts) masks spec.secretStoreRef whole, and a Secret's data is masked, which hides an Argo CD cluster Secret's name and server.
  • behold index <substrate>: fill an index from a cloud with no project, read-only #1026 and index: a read-only cloud lister over each cloud's inventory API, for behold index #1029 are open; their code is merged.

Change

Done when

  • On a scratch k3d cluster the test creates and deletes (never a shared or real cloud cluster) holding a Deployment, Service and ServiceAccount, behold graph on its context prints all three and the Service-to-Deployment edge.
  • The index store directory is unchanged after the run.
  • A fixture kubeconfig with an exec user gives a refusal naming the context, and nothing is listed.
  • An ExternalSecret on that cluster keeps a readable spec.secretStoreRef.name, shown red first.

Depends on

#1057. INTENTIUS/chant#5116 for the masked reference fields.

Activity

  1. added
    epic:surfaces
    wave:4
    on Nov 15, 2026
  2. lex00 commented on Nov 15, 2026

    @lex00
    ContributorAuthor

    Built on estate/1083-kubeconfig-bare-cluster, going into the next behold batch. behold graph --context <ctx> [--kubeconfig] [--namespace] [--types] draws a cluster through chant's read-only lister, with nothing written to any index store.

    Waiting on the maintainer: exec-plugin kubeconfigs. Right now they are refused by default, and --allow-exec-plugin (allowExecPlugin) lets them run. The options:

    • Keep refusing by default (current): behold never runs a command a kubeconfig names unless told to. Most GKE, EKS and AKS kubeconfigs need the switch, and the krew and k9s flow in kubectl behold through krew, then a k9s plugin entry #1086 will hit that.
    • Allow by default: this works like kubectl, but any kubeconfig handed to behold can make it run an arbitrary command.
    • Allow a named list (gke-gcloud-auth-plugin, aws, kubelogin): safer than allowing everything. It needs upkeep, and it still runs whatever binary of that name is first on PATH.

    auth-provider users are always refused, since kubectl dropped them.

    The output is correct whichever way INTENTIUS/chant#5116 rules on the Argo CD cluster Secret: config and tokens never appear. The ExternalSecret store cards draw once a chant release carrying #5116 is pinned. Until then they get a masked note.

    One finding. chant's indexCloud writes masked values as [REDACTED], but the lister writes <masked>. web/outside-refs.js knows only <masked>, so this read normalises [REDACTED] to <masked> for now. A single marker in chant would be better.

  3. lex00 commented on Nov 15, 2026

    @lex00
    ContributorAuthor

    Ruling (maintainer, 2026-11-15): keep exec-plugin kubeconfigs refused by default, with --allow-exec-plugin (allowExecPlugin) to opt in. behold does not run a command a kubeconfig names unless the person running it says so. kubectl behold (#1086) prints how to allow it. No change to what was built.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    epic:surfaceswave:4

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions