Skip to content

Pull actor images from private registries with a Kubernetes Secret (atelet credential-provider plugin + kustomize component + two-phase e2e) - #1

Merged
marcellodesales merged 9 commits into
planeo/mainfrom
feature/atelet-image-credential-secret
Oct 19, 2026
Merged

marcellodesales merged 9 commits into
planeo/mainfrom
feature/atelet-image-credential-secret

Conversation

@marcellodesales

Copy link
Copy Markdown

Internal review PR inside our fork (planeodev/google-substrate) — NOT sent upstream. Once you approve it, we open the discussion on agent-substrate#2669 first (the project asks to discuss before coding), and only then a PR to agent-substrate/substrate with these commits rewritten in your own words (their COLLABORATING.md forbids AI-generated commit messages and AI co-author trailers, requires disclosing AI use, and requires answering reviews without AI). The fork-only workflow (.github/workflows/planeo-private-pull-e2e.yaml) is NOT part of that upstream PR.

Why

atelet, Agent Substrate's node agent, pulls actor images itself with go-containerregistry. It does not use the kubelet, so imagePullSecrets cannot apply. It authenticates only through kubelet credential-provider exec plugins: agent-substrate#917 and agent-substrate#2104.

The install manifest wires those plugins to GKE node paths (/home/kubernetes/bin, /etc/srv/kubernetes/cri_auth_config.yaml). Other clusters (EKS, kind, bare metal) have no such files, so they have no supported way to pull a private image (agent-substrate#2669). BenTheElder's guidance on that issue is to kustomize the manifest, and "the chart needs to make this customizable".

This PR does exactly that, using only the extension point atelet already has. It makes no change to atelet, the API or the proto. It does not touch the per-tenant design (agent-substrate#868, agent-substrate#2080) or the docker-config keychain (agent-substrate#1919).

What

File What
cmd/dockerconfig-credential-provider/ A kubelet-protocol (credentialprovider.kubelet.k8s.io/v1) exec plugin that answers from a mounted .dockerconfigjson. It is registry-agnostic and has no dependencies. It re-reads the file on every call, so a rotated Secret applies without a restart. Its install <dir> subcommand copies the binary, because the distroless image has no cp. 7 unit tests.
manifests/ate-install/components/image-credential-secret/ A kustomize component. It replaces the GKE host paths with an emptyDir (filled by an init container running the plugin) and a ConfigMap (the CredentialProviderConfig), and mounts the Secret ate-system/atelet-registry-auth (kubernetes.io/dockerconfigjson, the same shape as an imagePullSecret) read-only and optional. It appends the two --image-credential-provider-* flags, which overlays such as kind drop.
manifests/ate-install/kind-image-credential-secret/ kind's atelet with the component applied, used by the e2e test.
internal/e2e/{probe,fixture}.go Two DeployProbe options: WithImage(ref) to run the probe from another image, and WithoutGoldenWait() for tests that expect the golden build to fail. DeploySubstrateFixture's signature is unchanged; it wraps an unexported variant.
internal/e2e/suites/imagepullsecret/ The two-phase e2e test, described below. It skips unless a private registry is configured.

Our setup on the Planeo platform (how we will run it)

Vault  planeo/platform/services/ghcr.io/pull  {username, token}      (read-only GHCR token, never printed)
  └─ External Secrets Operator, ClusterSecretStore vault-kv
     └─ ExternalSecret ate-system/atelet-registry-auth  →  Secret type kubernetes.io/dockerconfigjson
        └─ mounted read-only into atelet  (this component / the Solo chart value)
           └─ dockerconfig-credential-provider  ←  atelet's exec-plugin call for ghcr.io/planeodev/*
              └─ atelet pulls the PRIVATE image  →  golden snapshot  →  actor
apiVersion: external-secrets.io/v1
kind: ExternalSecret
metadata: { name: atelet-registry-auth, namespace: ate-system }
spec:
  refreshInterval: 1h
  secretStoreRef: { kind: ClusterSecretStore, name: vault-kv }
  target:
    name: atelet-registry-auth
    template:
      type: kubernetes.io/dockerconfigjson
      data:
        .dockerconfigjson: '{"auths":{"ghcr.io":{"username":"{{ .username }}","password":"{{ .token }}"}}}'
  data:
    - { secretKey: username, remoteRef: { key: platform/services/ghcr.io/pull, property: username } }
    - { secretKey: token,    remoteRef: { key: platform/services/ghcr.io/pull, property: token } }

This is the same pattern our tenants already use for ghcr-pull (customers repo base/ghcr-pullsecret.yaml). Any secret manager that produces a dockerconfigjson Secret works the same way.

Evidence: one CI run, two phases, a real private registry (GHCR)

Run: https://github.com/planeodev/google-substrate/actions/runs/39030809786 (✅ success). The full atelet logs and the JUnit results are in its artifact planeo-private-pull-evidence.

The setup is upstream's own e2e path: hack/create-kind-cluster.sh → hack/install-ate-kind.sh --deploy-ate-system (gVisor, envoy dataplane). The test copies the probe image to the private package ghcr.io/planeodev/google-substrate/e2e-private-probe.

  • Fresh digest: each copy carries a per-run annotation, so its digest is new and no node's image cache can serve it. A cache hit skips the network, and with it authentication.
  • Credentials: only the job's ephemeral GITHUB_TOKEN, masked in logs and stored only inside the throwaway kind cluster.

Phase 1 — denied: stock atelet, no credentials (E2E_PRIVATE_PULL_EXPECT=denied)

imagepullsecret_test.go:110: private copy: ghcr.io/planeodev/google-substrate/e2e-private-probe@sha256:c40d11b9e6c18c05d4c84634e189dedd63ee5b2e7529c5ace882c8a7a8da8a36
imagepullsecret_test.go:120: anonymous HEAD refused, as expected: GET https://ghcr.io/token?scope=repository%3Aplaneodev%2Fgoogle-substrate%2Fe2e-private-probe%3Apull&service=ghcr.io: UNAUTHORIZED: authentication required
imagepullsecret_test.go:124: golden build failed without credentials: GoldenActorCrashed: golden actor crashed before its snapshot was taken
imagepullsecret_test.go:124: atelet: … "method":"/atelet.Atelet/Run" … "err":
    while creating "probe" OCI bundle: in imageCache.EnsureImage("ghcr.io/planeodev/google-substrate/e2e-private-probe@sha256:c40d11b9…"):
    in remote.Image: GET https://ghcr.io/token?scope=repository%3Aplaneodev%2Fgoogle-substrate%2Fe2e-private-probe%3Apull&service=ghcr.io:
    UNAUTHORIZED: authentication required
--- PASS: TestActorImageFromPrivateRegistry (41.11s)

The template status only says GoldenActorCrashed. The registry's refusal is in atelet's own log, on the EnsureImage of that exact digest, and the test asserts it there by reading the atelet pods' logs.

Phase 2 — allowed: the Secret is created, then atelet is re-applied with the component (E2E_PRIVATE_PULL_EXPECT=allowed)

imagepullsecret_test.go:110: private copy: ghcr.io/planeodev/google-substrate/e2e-private-probe@sha256:f3ca1cf33f9c9a3eb5e45ef725b47868b89db2f2af888b29ba7ae774ec67b961
imagepullsecret_test.go:120: anonymous HEAD refused, as expected: … UNAUTHORIZED: authentication required
imagepullsecret_test.go:134: golden snapshot built from the private image in atespace ate-e2e-probe-imagepullsecret
--- PASS: TestActorImageFromPrivateRegistry (19.93s)

atelet's log for that digest (artifact atelet-krtm9.log) shows the whole request group that loaded the image:

time (UTC) atelet meaning
12:12:52.032 Image cache miss ref=…e2e-private-probe@sha256:f3ca1cf3… nothing cached; atelet must go to GHCR
12:12:54.229 Image pulled into layer cache authenticated pull succeeded: the plugin returned the Secret's credentials
12:12:54.399 Handle RPC /atelet.Atelet/Run the golden actor boots from the private image
12:12:54.535 Handle RPC /atelet.Atelet/Checkpoint golden snapshot taken

Same image, same registry, same cluster, same code path. Without the Secret the pull is refused, and with it the pull succeeds.

Checks

Limits (stated plainly for the upstream discussion)

Review checklist for you

  • the component's name and shape: components/image-credential-secret, Secret name atelet-registry-auth, broad default matchImages (narrowing is documented)
  • the plugin living in this repo (cmd/) and built by their ko pipeline, rather than in a separate repo
  • the e2e design (fresh digest, anonymous-refusal precondition, denied then allowed, the assertion on atelet's log)
  • then: I draft the [Bug]: atelet credential-provider configuration is hard-coded to GKE host paths agent-substrate/substrate#2669 comment for you to post, and you rewrite the commits for the upstream PR

Add cmd/dockerconfig-credential-provider, a kubelet-protocol image credential
provider that answers atelet's credential-provider exec calls from a mounted
.dockerconfigjson Secret, and the kustomize component
manifests/ate-install/components/image-credential-secret that installs it
without GKE host paths (plugin via an init container into an emptyDir, config
from a ConfigMap, credentials from the Secret ate-system/atelet-registry-auth).

Add the e2e suite internal/e2e/suites/imagepullsecret and the DeployProbe
WithImage option it uses: a fresh-digest copy of the probe in a private
registry must be refused anonymously and still reach its golden snapshot.

Refs agent-substrate#2669, agent-substrate#868, agent-substrate#1919.
…s upstream's micro-VM demo, which this scoped job does not install)
…private image) before the allowed one; capture atelet pull evidence
…mponents (published with the release images; manifests and the list agree)
@marcellodesales marcellodesales self-assigned this Oct 17, 2026
@marcellodesales

Copy link
Copy Markdown
Author

Submitted upstream as agent-substrate#2799: one squashed commit on the latest upstream main, without the fork-only planeo-*.yaml workflows, with the AI-assistance disclosure. Production verification on planeo-prod: https://github.com/planeodev/planeo-infra/pull/496 (Chainsaw kagent-private-byo-image PASS). Cross-references: agent-substrate#2669, agent-substrate#868, kagent-dev/kagent#2815.

@marcellodesales
marcellodesales changed the base branch from main to planeo/main October 18, 2026 23:35
@marcellodesales
marcellodesales merged commit a1f7d4d into planeo/main Oct 19, 2026
10 checks passed
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