Running ACE in an enterprise environment or open setup: image registry plan
1. problem
ACE runs about 90 container images: our own, Litmus, Langfuse, Mongo, the demo apps and the build base images. Today they are pulled from public registries such as Docker Hub, quay.io, ghcr.io and registry.k8s.io.
- Inside the Infosys network, public registries are blocked. Every image has to come from JFrog Artifactory (
infyartifactory.jfrog.io/docker-local), and pulling needs a login. - Outside the network (open source), people have no enterprise registry access. Everything has to come from the public registries, with no login.
2. The goal : let .ENV be the Single Source of Truth
One setting in
.envdecides where every image comes from.
# Open / local setup (default): leave it empty → images come from their normal public home
IMAGE_REGISTRY=
# Enterprise environment: set it → every image comes from the enterprise registry
IMAGE_REGISTRY=infyartifactory.jfrog.io/docker-local
REGISTRY_USERNAME=<your id>
REGISTRY_PASSWORD=<registry access token>
IMAGE_PULL_SECRET_NAME=registry-pull
Nothing else should have to change between the two setups.
The naming rule
| Setting | mongo:5 becomes | quay.io/containers/kubernetes_mcp_server:v0.0.67 becomes |
|---|---|---|
IMAGE_REGISTRY empty | agentcert/mongo:5 (frozen copy on Docker Hub) | agentcert/containers-kubernetes_mcp_server:v0.0.67 (frozen copy on Docker Hub) |
IMAGE_REGISTRY set | infyartifactory.jfrog.io/docker-local/mongo:5 | infyartifactory.jfrog.io/docker-local/quay.io/containers/kubernetes_mcp_server:v0.0.67 |
In other words: if the setting is set, put it in front of the normal name. If it is empty, use ACE’s frozen copy on Docker Hub (IMAGE_MIRROR_NAMESPACE, default agentcert). Docker Hub repos can’t nest, so the copy’s name drops the registry host and turns / into -. ACE’s own agentcert/* images keep their names. IMAGE_MIRROR_NAMESPACE=none pulls straight from upstream.
Why frozen copies for open source too: third-party tags such as grafana/grafana:latest or prometheus-mcp-server:latest move, and upstream images get archived or deleted. Copying each image once into agentcert/ pins exactly the version ACE was tested with, for both environments (enterprise registry copies are frozen the same way).
Why this rule:
- Empty, not
docker.io. If the default weredocker.io, images that live elsewhere would break for open-source users. For example,docker.io/containers/kubernetes_mcp_serverdoes not exist.
3. How the pieces fit (read this first)
Images get pulled at three different moments, by three different parts of the system. Each part needs to know the registry, and each needs the login.
┌──────────── .env (IMAGE_REGISTRY, credentials) ────────────┐
│ │
▼ (1) BUILD time ▼ (2) DEPLOY time ▼ (3) EXPERIMENT time
build-and-push.sh setup.sh → Helm "ace" graphql server (Go) creates:
Dockerfiles (FROM …) installs the platform: • chaos infra (Litmus, Argo, MCP)
→ pushes our images graphql, auth, web, • workflow → install-app → app-charts
to the registry certifier, mongo, (sock-shop, bookinfo, otel-demo)
langfuse, litellm • workflow → install-agent → agent-charts
(flash-agent, sre-agents + sidecar)
• fault pods (chaos-charts)
4. Where we stand today
90 images were checked with check-jfrog-images.sh:
| Result | Count | Examples |
|---|---|---|
| ✅ Present with the right tag | 64 | mongo, postgres, redis, langfuse, litellm, metrics-server, all Litmus infra and helpers, sock-shop |
| ⚠️ Repo present, wrong tag | 12 | clickhouse-server:26.8 (only latest), kubernetes_mcp_server:v0.0.67 (only latest), alpine/k8s:1.29.2, curl:8.10.1, node:20-alpine, ollama |
| ❌ Missing | 14 | ace-hub-bundle, itbench-experiment, sre-agent*, ciso-agent, 6 bookinfo images (registry.istio.io), ubi10-minimal, distroless, kindest/node |
| 🕒 Present but old | all agentcert/* | old images |
Gaps in the code today:
- The Helm chart has no registry setting and no pull secret.
apply_cluster_prereqs.shexists, butsetup.shnever calls it. It also references a file that doesn’t exist (deploy/jfrog-secret-sync.yaml).- Two different secret names are used:
jfrog-registryandjfrog-pull-secret. - The Go server, app-charts, agent-charts and chaos-charts have no way to add a registry or a pull secret.
- The only exceptions are install-app/install-agent and a Litmus-helper-only prefix.
5. The phases
Each phase lists what changes and why it is done that way.
Phase 0: Populate the enterprise registry with every image
What
deploy/images.txt: one list of every image ACE needs, grouped by platform, infra, workflow, agents, apps and build.scripts/check-registry-images.sh: reports OK / wrong tag / missing for every image in the list. This is the script used for section 4.scripts/mirror-images.sh: for third-party images (mongo, litmus, langfuse, bookinfo, …).- Runs on a machine that can reach the internet.
- Pulls each image from its public home, renames it with the rule from section 2, and pushes it to the enterprise registry.
- Skips images that are already there.
scripts/build-and-push.sh(improved): for our own images (agentcert/*).- Builds them from this branch and pushes them to
IMAGE_REGISTRYinstead of always to Docker Hub. - Pushes
latestand a fixed tag such as the git commit. - Covers images that were never pushed:
ace-hub-bundle,itbench-experiment,sre-agent*,ciso-agent.
what pushes future changes? Yes. After this phase, running
build-and-push.sh --pushwithIMAGE_REGISTRYset pushes new builds to the enterprise registry. With it empty, they go to Docker Hub.- Builds them from this branch and pushes them to
Why
- Every later phase only switches image names to the enterprise registry. If an image isn’t there, the pod fails with
ImagePullBackOff. Populating the enterprise registry first means later failures point at the code, not at missing images. - Two scripts, not one. Our images are built from source; third-party images are copied. Mixing them would rebuild things we don’t own, or copy stale copies of things we do.
- For wrong-tag images, choose per image: push the tag we use, or change our files to a tag the enterprise registry already has. Pushing is preferred so the open and enterprise setups run the same versions.
Phase 1: .env becomes the single source
What
- Add
IMAGE_REGISTRY(empty by default),REGISTRY_USERNAME,REGISTRY_PASSWORDandIMAGE_PULL_SECRET_NAME=registry-pull. - Remove:
JFROG_HOST,JFROG_REGISTRY_PATH,JFROG_USER,JFROG_TOKENDOCKERHUB_USERNAME,DOCKERHUB_TOKENLITMUS_HELPER_IMAGES_REGISTRY_PREFIX
These are all replaced by the settings above.
- Every
*_IMAGEvalue holds the normal public name (e.g.litmuschaos/chaos-operator:3.0.0), never an enterprise registry-prefixed name. The prefix is added later, automatically. *_IMAGE_SOURCEdropsjfrog | dockerhub | localand becomeslocal | registry.registrymeans “pull from whereverIMAGE_REGISTRYpoints”.
Why
- Today the registry is spread over about eight settings, and changing networks means editing many lines. A single setting can’t drift out of sync.
Phase 2: Cluster preparation (apply_cluster_prereqs.sh)
What it does. It doesn’t fetch images. It gives the cluster the login and the corporate certificate:
- Creates the pull secret, holding the registry username and token, in every namespace that runs our pods:
ace,litmus,kube-system,sock-shop,book-info,otel-demo,itbench,litellm. - Attaches the secret to the service accounts in those namespaces, so pods use it automatically.
- The corporate (Zscaler) root certificate is not handled here:
setup.sh’screate_ca_configmapalready creates theace-ca-certsConfigMap graphql mounts, so a second ConfigMap would duplicate it. - Installs
deploy/registry-secret-sync.yaml, which copies the secret into any new namespace within seconds and attaches it to every ServiceAccount. Experiments create namespaces on the fly. Namespaces labelledace.registry-sync=disabledare left alone.
Changes
setup.shruns it only whenIMAGE_REGISTRYis set.- One secret name everywhere (
IMAGE_PULL_SECRET_NAME), including inprepare-images.sh. - Remove its built-in registry default, and stop it from editing
.env. - Add the missing sync manifest (
deploy/registry-secret-sync.yaml, vendor-neutral name). Its kubectl image isalpine/k8s:1.29.2, already inimages.txt. - Switching
IMAGE_REGISTRYback to empty removes the sync (apply_cluster_prereqs.sh --deploy --uninstall).
Why
- Pointing an image name at the enterprise registry is only half the job. Without the login, the enterprise registry refuses the pull with
401. - Running it only when the setting is set means open / local users never see a registry prompt.
- One secret name: today one script creates
jfrog-registryand another createsjfrog-pull-secret, so pods look for a secret that isn’t there. - The sync is needed because experiment namespaces don’t exist at setup time, so a one-off script can’t cover them.
Phase 3: Helm chart ace (deploy time, the platform)
What it is: see section 3. It is the package setup.sh installs for graphql, auth, web, certifier, mongo, langfuse and litellm. It runs once, during setup.sh.
What changes
values.yamlgetsimageRegistry: ""andimagePullSecretName: "".- A small template helper,
ace.image, adds the prefix to each image only whenimageRegistryis set. Everyimage:line uses it. - Every pod gets
imagePullSecrets, but only when a secret name is set. setup.shpasses both values from.envinto Helm.- The image-drift check in
setup.sh(deploy/image-baseline.tsv) is updated so it still recognises the prefixed names.
As built: images setup.sh builds or side-loads keep their public names (aceImagesLocal for graphql/auth/web/certifier with PLATFORM_IMAGE_SOURCE=local, chartsHub.bundleLocal, runtimeImagesLocal for metrics-server). Otherwise kubelet would silently pull an older registry copy instead of the fresh local build. The drift check keys each image by the name the cluster actually pulls.
Why
- The image names stay readable in
values.yaml, the prefix is decided in one place, and an empty value gives exactly today’s behaviour. - This replaces the approach of writing enterprise registry names into
values.yaml.
Phase 4: The graphql server (Go, experiment time)
This is the largest phase, because most pods are created by graphql while an experiment runs, not by setup.sh.
What changes
- graphql reads
IMAGE_REGISTRYandIMAGE_PULL_SECRET_NAME. - Chaos infra (subscriber, event-tracker, chaos operator, Argo, MCP servers): graphql writes these manifests itself. It adds the prefix and an
imagePullSecretsentry. - One rewrite step when a workflow is submitted. It extends the existing
ApplyLitmusHelperImageOverridesfunction, which today only handles Litmus helper images. It must cover:- every container image in the workflow,
- images inside the fault definitions,
- image values passed as settings (
TC_IMAGE,DEBUG_IMAGE,GENERATOR_IMAGE, …).
- It must not rewrite
INVALID_IMAGEandINVALID_ARCH_IMAGE. Those faults deliberately use a broken image. - It passes the registry on to install-app (app-charts) and install-agent (agent-charts and the sidecar).
- Fix an existing bug: a custom
AGENT_SIDECAR_IMAGEcurrently getsdocker.io/stuck in front of it. - Send images hardcoded in Go (
litmuschaos/k8s,busybox) through the same rewrite.
As built: the rule lives in a new package, pkg/imageref. ApplyRegistryImageOverrides runs next to ApplyLitmusHelperImageOverrides at all four submit points and also adds the workflow’s imagePullSecrets. Infra manifests get an #{IMAGE_PULL_SECRETS} placeholder, which stays a YAML comment on the public path. The sidecar fix splits a registry host into sidecar.image.registry, which also renders correctly with older agent charts. Settings reach the installers as environment variables rather than flags, so an older installer image ignores them instead of failing. Components set to local in .env keep their side-loaded public names.
Why
- Rewrite at run time instead of editing 64 fault files.
- The fault files are packed into one “hub bundle” image built from this branch.
- If they contained enterprise registry names, there would need to be a separate bundle for each environment, and open / local users would get enterprise registry names. That is what happened on main, where
fault.yamlfiles were rewritten withsed. - With the rewrite, the files stay public and graphql adds the prefix only when it is set.
- Reusing the existing function extends tested code instead of adding a second mechanism.
Phase 5: app-charts and agent-charts (experiment time)
- app-charts install the demo app that gets broken on purpose (sock-shop, bookinfo, otel-demo).
- agent-charts install the AI agent that has to detect and fix the breakage.
Both are installed inside the cluster during an experiment, by the install-app and install-agent pods that graphql starts.
What changes
- app-charts:
- Add a
global.imageRegistrysetting, an image helper andimagePullSecrets. This mirrors Phase 3. - For otel-demo, use the upstream subchart’s own registry and pull-secret settings.
- Add a
- agent-charts:
- They already have a
registry:setting, but it always adds a/, so an empty value gives/agentcert/..., which is invalid. Add a guard. - Add
imagePullSecrets. - Turn the fixed
litellm/deployment.yamlinto a template.
- They already have a
- install-app and install-agent copy the pull secret into the target namespace before running
helm install.
As built (deviation): image rewriting is done by a Helm post-renderer built into install-app, install-agent and graphql (direct agent installs and uploaded charts), not by template helpers in each app chart. The otel-demo upstream subchart takes images from five settings and hardcodes busybox:latest init containers inside value lists, which no chart setting can reach. The post-renderer rewrites every rendered image:, adds imagePullSecrets to every pod, and needs no new Go dependency. The agent charts additionally got the empty-registry guard and an imagePullSecrets value. agent-charts/litellm/deployment.yaml is only a manual local-dev manifest (the platform LiteLLM comes from the Helm chart), so it moves to Phase 6. The installers carry a generated copy of pkg/imageref (scripts/lib/sync-imageref.sh; the test suite fails if a copy drifts).
Why
- These charts start about 30 images: the sock-shop services, bookinfo, Prometheus, Grafana and the agents. If they keep public names, experiments fail in enterprise environments even when the platform is healthy.
- Copying the secret just before install closes a timing gap: the namespace is brand new, and the sync from Phase 2 may not have reached it yet.
Phase 6: Builds, compose and the rest
What changes
- Every Dockerfile gets
ARG REGISTRY_PREFIX=(empty by default), used asFROM ${REGISTRY_PREFIX}golang:1.24.build-and-push.shpassesIMAGE_REGISTRY/. - Add a
KIND_NODE_IMAGEsetting. This only matters for local kind clusters; AKS doesn’t use it. - The docker-compose files use
${IMAGE_REGISTRY:+${IMAGE_REGISTRY}/}mongo:5. That form adds the prefix and the/only when the setting is set. - Delete the old flat manifests in
deploy/k8s/*.yaml(Helm replaces them), or render them withenvsubst.
Why
- Building inside an enterprise environment also pulls base images (
golang,python,node,ubi), which are blocked. - An empty default keeps every Dockerfile working on its own for open-source users.
- Plain
${IMAGE_REGISTRY}/mongo:5breaks when the setting is empty, because it becomes/mongo:5. Hence the:+form.
Phase 7: Merge to main
What
- Merge each submodule first (AgentCert, app-charts, agent-charts, chaos-charts, certifier, litmus-go, agent-sidecar), each on its own branch.
- Then merge the monorepo, updating the submodule pointers.
- Do not bring over hardcoded enterprise registry values or its
sed-editedfault.yamlfiles.
6. Proof ->
The test that matters is: with IMAGE_REGISTRY set, does any pod still try to pull from outside the enterprise registry? And with it empty: does anything reference the enterprise registry URL?
Test 1: Before deploying (fast, no cluster)
| Check | How | Pass |
|---|---|---|
| Registry is complete | scripts/check-registry-images.sh | Every line OK |
| Helm output, set | helm template ace deploy/helm/ace --set imageRegistry=infyartifactory.jfrog.io/docker-local --set imagePullSecretName=registry-pull \| grep 'image:' | Every image starts with the JFrog prefix, and every pod has imagePullSecrets |
| Helm output, empty | The same command without the --set flags | No jfrog anywhere; output identical to today |
| Go rewrite | Unit tests on the rewrite function, fed real workflow and fault YAML | Every image prefixed except INVALID_IMAGE and INVALID_ARCH_IMAGE |
| app/agent charts | helm template each chart with and without the registry setting | As for the Helm checks above; no // or leading / in any image |
Test 2: Enterprise environment, the real proof (fresh AKS or VM cluster)
- Use a brand-new cluster. Kubernetes caches images on its nodes. On an old cluster, a pod could start from a cached public image, and the test would pass while the real setup is broken.
- Set
IMAGE_REGISTRYand the credentials, then run./scripts/setup.sh --deploy. - Run one experiment of each kind:
- sock-shop + flash-agent + pod-delete
- bookinfo + an sre-agent + network latency
- one itbench fault
- then generate a certificate
- Run the image audit. It lists every image every pod actually used:
kubectl get pods -A -o jsonpath='{range .items[*]}{.metadata.namespace}{"\t"}{range .spec.initContainers[*]}{.image}{" "}{end}{range .spec.containers[*]}{.image}{" "}{end}{"\n"}{end}' \ | tr ' ' '\n' | grep -v '^$' | grep -v '^infyartifactory.jfrog.io/docker-local/' | sort -uPass: the output is empty, apart from
kube-systemcluster add-ons owned by AKS and the deliberately invalid fault images. - Check for pull errors:
kubectl get events -A | grep -E 'ErrImagePull|ImagePullBackOff|401|unauthorized'Pass: none.
Test 3: Open / local environment
- On a machine outside the network (a personal laptop or a GitHub Actions runner), clone, leave
IMAGE_REGISTRYempty and run./scripts/setup.sh --deployon a fresh kind cluster. - Run the same experiments.
- Pass:
- No enterprise registry prompt.
grep -ri jfrogover the rendered values and the running pod specs finds nothing.- Every experiment completes.
Test 4: Switching back and forth
On the enterprise cluster, switch IMAGE_REGISTRY from set to empty, re-run setup.sh --restart, then switch it back.
Pass:
- Each switch changes only image names and pull secrets, with no manual edits.
- The image audit flips as expected.
Rollout tip
Run Test 1 at the end of every phase, and Tests 2 and 3 once Phase 5 is done. Phases 3–5 can be shipped one at a time: the image audit shows which pods are still on public names, which is effectively a progress bar.