Start with the app that Argo CD or Flux deploys from Git. Connect a hub to keep the app's settings and their reasons, then choose how GitOps should deliver. When the hub is the source, the controller receives the revision you approve for production.
The steps, with every command and what it prints, are in the walkthroughs a Kustomize app that Argo CD deploys and a Kustomize app that Flux deploys: each connects the app, moves its delivery to the hub with no pod restarted, changes it, undoes the change, moves it to a shared hub and deletes it. To pair coding agents with Flux or Argo CD inside your GitOps repo on day one (.claude/settings.json, AGENTS.md, skill, and optional MCP server—working read-only for both Helm and Kustomize), see AI for Flux and AI for Argo CD. How deploying from the hub works, self-heal and your own cluster are in GitOps over OCI.
The words on this page, such as hub, base and change order, are explained in the glossary.
| Way | What deploys | Where your approval holds | To go back |
|---|---|---|---|
| 1. The hub beside Git | Git, as today | In the hub only. A merge to the branch still changes production | Stop the hub. Git is untouched |
| 1b. Self-hosted hub recording your PR flow | Git, as today | GitHub branch protection and CODEOWNERS, as today; each PR's rendered diff, reasons, and approvers are recorded as immutable attestations in a self-hosted hub behind SSO (walkthrough) | Remove the workflow inputs. Git is untouched |
| 2. The hub beside Git, with a check on each pull request | Git, as today | A pull request whose files differ from the approved copy fails, and branch protection requires the check | Remove the required check, stop the hub |
| 3. The hub as the source for one app | The hub, over OCI, through the same Argo CD or Flux | Only an approved change reaches the cluster. A change made on the cluster by hand is put back | Write the app back to Git, point the controller at Git again, stop the hub (below) |
Each step is one app at a time, and each can be undone. Start with the first. Managing 40+ Helm releases on Argo CD or Flux? Follow the 3-stage Workshop-aligned Helm architecture (Stage 1: read-only inventory + PR review + CODEOWNERS across all 40 releases with no 12-chart cap; Stage 2: classify by flattening verdict; Stage 3: selective render-once OCI for safe-to-flatten charts + explicit render-late for unsafe-to-flatten charts).
In Claude Code, in the repository, ask the agent to "attach ConfigHub to this existing app: keep my staging and production values exactly as they are, and make sure an agent cannot change production without my say". The agent adopts the Kustomize repository as it is: the base as kustomize renders it, staging's own values from overlays/staging, and live's own from the prod overlay, or from the overlay an Argo CD Application in the repository deploys. An overlay whose changes a copy cannot hold, such as one that adds a resource, is refused by name, and nothing is written (what adopt refuses). What the agent runs and what you approve are in an app you already have.
The agent then says what this does not cover: Argo CD or Flux still syncs production from Git, so a merge to the branch still changes production without your approval. That is way 1. Agents propose in the hub, and you approve there. Close the Git route with way 2 or way 3.
The person who approves a change writes the approved copy out for Git, as plain files and a CHANGES.md that says why each value is set. A GitHub workflow compares each pull request's files with the hub's approved copy, value by value, and sets a status that branch protection requires. A pull request with a value nobody approved fails, and names it, for example "Deployment/api/spec.replicas: 5 here, 2 in the hub".
GitHub's runners cannot reach a local hub on a laptop. Use a shared hub on confighub.com or a server of your own for the workflow, or run the same check from your laptop. The steps: when a cluster deploys from Git.
Here the app moves from Git to the hub under the same controller, with no pod restarted. One command does each move, for an app adopted from a Kustomize repository or uploaded with cub repo upload FOLDER --variant live --target none:
cub repo deploy-from-hub APP --variant live --repo DIR finds the one Argo CD Application or Flux Kustomization that deploys the copy, and points it at the hub. It refuses, and says what it found, when none or several deploy it, when the copy holds other objects than Git deploys, or when its pod templates differ from what runs. It checks that the same pods run before and after. --dry-run says what it would change. A person runs it: on an agent's key it refuses.To try it on your laptop, the starter walkthroughs make a kind cluster with cub cluster up. For your own cluster, use a shared hub on confighub.com or a server of your own, with cub cluster attach (your own cluster).
By hand, under Flux. For a Kustomization shop that syncs the folder ./api from Git, the same move is three commands. Pause the Kustomization, which changes nothing on the cluster: kubectl -n flux-system patch kustomization shop -p '{"spec":{"suspend":true}}'. Put the folder in the hub as its live copy, with a reason: cub repo upload shop/api --variant live --namespace shop --change-desc "WHY"; Flux then applies the same Deployment from the hub's registry, and no pod is recreated. Then put live behind your approval: cub agent require-approval api --variant live --agent shop-agent.
cub repo back-to-git APP --variant live --repo DIR writes the copy into the folder the controller deployed from, with a CHANGES.md that says why each value is set, commits it, and once the controller's Git source has the commit, puts the controller back as it found it. --push pushes the commit; --stop-hub stops the hub once no copy deploys from it. The same Deployment and the same pods run on.
It waits for the Git source on purpose: a Flux Kustomization resumed on the commit from before the hub sets the old values back, and removes and remakes pods.
By hand. Write the live copy out with cub local copy api --variant live --to-dir for-git, copy for-git/api-live/ and its CHANGES.md into the folder your Kustomization reads, then commit and push. Wait until flux get sources git shows that commit. Remove the hub's Flux objects, which do not prune, so the app keeps running: kubectl -n flux-system delete kustomization,ocirepository confighub-root api-live. Resume your own Kustomization ("suspend":false), and stop the hub with cub local stop.
cub repo upload keeps pod templates as your files have them, so taking a running app over restarts nothing; it takes out the hash annotation ConfigHub would add, and says so. cub repo upload --roll-on-configmap keeps that annotation instead, so a ConfigMap change restarts the pods that use it. Check kubectl get pods before and after, on a kind cluster first.flux get sources git shows the hand-back commit; cub repo back-to-git waits for it.kind, kubectl, and a kind cluster with Flux or Argo CD.Each can be undone: way 3 by handing the app back to Git, and the hub with cub local stop, or cub local uninstall --delete-data to remove it and its data (going back).
After way 1:
cub inbox list, then the cub inbox approve command it prints./confighub:inventory: what the repository deploys, and what deploys each part.cub repo drift --dir DIR on the checkout the controller deploys: each field on the cluster that Git does not set, with who set it. It only reads.Then try way 3 on a kind cluster, with a starter walkthrough, before you move an app your team relies on.