This page is for a platform team that runs Flux or Argo CD, and whose agents now propose changes to what those tools deploy. It shows how to make the cluster deploy only changes a named person has approved, with the reason for each value kept. To move an app that Argo CD or Flux already deploys from your Git, and hand it back, see an app that Argo CD or Flux deploys.
The walkthroughs a Kustomize app that Argo CD deploys and a Kustomize app that Flux deploys do this on a kind cluster with a starter, with every command and what it prints.
Today, your cluster's Flux or Argo CD deploys whatever reaches the Git branch it watches. A person has to read every agent's diff to know whether it should ship. Nothing in Git says why a value is what it is.
With this setup, your cluster's Flux or Argo CD pulls the approved configuration from ConfigHub instead of from Git:
A change someone makes by hand on the cluster is put back. Going back to an earlier value is an approved change like any other. For every release, ConfigHub shows what the cluster reported about it.
You can keep writing and reviewing changes in Git. What the cluster runs is what was approved in ConfigHub. Flux calls this Gitless GitOps.
You do not have to move delivery off Git to get anything on this page. Each step below is reversible, and you can stop at any of them.
| Step | What changes | What you get | To go back |
|---|---|---|---|
| 1. The Claude plugin | the record in agent sessions; the review on pull requests | every configuration value a pull request changes, per cluster, and why; the next agent told before it undoes an earlier change; Git still delivers | uninstall the Claude plugin |
| 2. A hub beside Git | cub local copy --from-git takes the repository's rendered configuration into a hub, which keeps each value's reason and protects the ones you choose; the hub's approval appears on each pull request as a status, and your branch rule requires that status | approvals of exact values; values kept through a chart's next version; Git still delivers. The branch rule requiring the status is what makes the approval one that Git cannot bypass | stop the hub; Git is untouched |
| 3. The hub as the source for one app | that app's Flux source or Argo CD Application is pointed at the hub's OCI gateway instead of the Git path; Git keeps everything else | the hub's approval is the only way a change reaches that app; an agent's kubectl change is set back by the next sync, and the hub says what differed | cub local copy --to-dir writes plain files and a CHANGES.md; commit them, point the source back at Git, stop the hub |
| 4. The hub as the source for everything | the clusters deploy from the hub; Git holds rendered files written back for people to read and diff | one source, with Git still legible | as step 3, app by app |
Steps 1 to 3 have run; the rest of this page is step 3. Step 4's write-back to Git is not built. Nothing on this page is a migration: a GitOps team meets the hub as the source for one app, beside its Git, and goes back by committing files.
The words on this page, such as hub, base and change order, are explained in the glossary.
kind (Kubernetes in Docker) and kubectl.flux CLI.The steps below set this up on the local hub and a local kind cluster. Then they show the four things a GitOps team asks about: a change that waits for a person's approval, self-heal, going back, and the cluster's status in ConfigHub.
The cub mini commands on this page are plain cub with the rest of the request filled in (which commands). For your own cluster with a shared hub on confighub.com, further down, the same is shown with cub alone.
The example follows Dan's platform team, which runs Flux and Argo CD with self-heal on.
cub cluster up shop --controller fluxThis makes a kind cluster named shop, installs Flux in it, and connects it to the hub. It adds:
OCIRepository and a Kustomization, which pull the cluster's apps from ConfigHub;To install Argo CD in place of Flux, use --controller argo (With Argo CD).
source ~/.confighub/clusters/shop.envThis sets KUBECONFIG, and the cub context for the cluster.
On OrbStack, put gitops/docker first on your PATH for this step. Otherwise cub points the cluster at an address that does not reach a hub listening on 127.0.0.1. With Docker Desktop you do not need this.
mkdir api
cat > api/namespace.yaml <<'EOF2'
apiVersion: v1
kind: Namespace
metadata: {name: shop}
EOF2The Namespace belongs with the app, since Flux creates nothing it is not given.
cat > api/api.yaml <<'EOF2'
apiVersion: apps/v1
kind: Deployment
metadata: {name: api, namespace: shop}
spec:
replicas: 2
selector: {matchLabels: {app: api}}
template:
metadata: {labels: {app: api}}
spec:
containers:
- {name: api, image: registry.k8s.io/pause:3.10}
EOF2api with a live copy:
cub repo upload api --variant live --namespace shop --yesFlux now runs 2 replicas of api, pulled from the hub.
This is what Flux pulls from, as cub cluster up and cub repo upload set it up:
apiVersion: source.toolkit.fluxcd.io/v1
kind: OCIRepository
metadata: {name: api-live, namespace: flux-system}
spec:
url: oci://host.docker.internal:PORT/space/api-live # the hub's OCI registry, one repository per Space
ref: {tag: latest}
secretRef: {name: confighub-oci} # the cluster's own key to the hub
interval: 10m
---
apiVersion: kustomize.toolkit.fluxcd.io/v1
kind: Kustomization
metadata: {name: api-live, namespace: flux-system}
spec:
sourceRef: {kind: OCIRepository, name: api-live}
path: .
interval: 10m
prune: false
wait: truebot:
cub agent require-approval api --variant live --agent bot--agent bot gives the agent a key of its own, in a cub configuration of its own, ~/.confighub-agent-bot. The next two commands run cub as the agent, by pointing CUB_CONFIG and CUB_CONTEXT at that configuration.
CUB_CONFIG=~/.confighub-agent-bot CUB_CONTEXT=bot cub function set --space api-base --unit api --change-desc "Four for the sale" set-replicas 4CUB_CONFIG=~/.confighub-agent-bot CUB_CONTEXT=bot cub changeorder create --space api-base sale-4 --component api --change-workflow workflows/api-live-approval --description "Four for the sale"The agent's change waits. Nothing is released, and the cluster still runs 2 replicas.
cub inbox approve api-live --note "Checked: four is right for the sale"It shows the change and asks first. ConfigHub releases the change, and k8sbot asks Flux to deploy it. Shortly after, the cluster runs 4 replicas.
kubectl -n shop scale deploy api --replicas=7flux reconcile kustomization api-live -n flux-system --with-sourceFlux applies the approved release again, and the cluster is back at 4 replicas.
Without the flux reconcile, Flux does the same at its next interval, which is 10 minutes here. Argo CD, with self-heal on as cub cluster up sets it, put the approved value back by itself.
Going back is a change like any other, so it waits for an approval too.
cub function set --space api-base --unit api --change-desc "The sale is over" set-replicas 2cub changeorder create --space api-base back-to-2 --component api --change-workflow workflows/api-live-approval --description "The sale is over"cub inbox approve api-base/back-to-2 --note "Back to two"Shortly after, the cluster runs 2 replicas again.
cub variant demote restores the earlier revision in the hub, but it is not the way back here. Where approval is required, ConfigHub releases only what an approved change order covers. So the way back is a change order, as above.
$ cub release list --space api-live
NUM TAG CHANGEORDER PUBLISHED SYNC HEALTH
3 api-base/back-to-2-co-publish api-base/back-to-2 true Synced Healthy
2 api-base/sale-4-co-publish api-base/sale-4 true OutOfSync Unknown
1 release-1 true OutOfSync UnknownEach line is one release. It shows the change order that made the release, and what k8sbot last reported from the cluster. Only the release running now reads Synced. Earlier releases read OutOfSync once a later one has replaced them.
cub cluster up shop --controller argo installs Argo CD in place of Flux. Each deployment is an Argo CD Application that reads the hub's OCI registry, with auto-sync and self-heal on:
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata: {name: api-live, namespace: argocd}
spec:
project: default
source:
repoURL: oci://host.docker.internal:PORT/space/api-live
targetRevision: latest
path: .
destination: {server: https://kubernetes.default.svc}
syncPolicy:
automated: {selfHeal: true, allowEmpty: true}The other steps are the same, except that step 4 needs no flux reconcile. Argo CD's UI is at the address cub cluster up prints.
With Argo CD, the approved change runs a few seconds after the promotion, and so does going back. Every release reads Synced and Healthy.
The same works with a cluster you already have and a shared hub on confighub.com, or a ConfigHub server of your own.
cub auth login, and point kubectl at your cluster.cub cluster attach my-clustercub cluster attach connects the cluster your kubeconfig points at to ConfigHub. It creates no cluster. It adds:
An Argo CD already in the argocd namespace is left as it is. Otherwise Argo CD is installed. You need Argo CD v3.1 or later, for oci:// sources.
For Flux, run cub cluster attach my-cluster --controller flux instead. A Flux already in flux-system is left as it is.
cub component create api
cub space create api-base --component api --variant base
cub unit create --space api-base namespace api/namespace.yaml
cub unit create --space api-base api api/api.yaml
cub variant create live api-base --target my-cluster/target
cub release publish api-liveArgo CD pulls the release from oci://oci.hub.confighub.com:443/space/api-live.
cub alone, as in approvals.cub variant approve api-base --change-order api-base/sale-4 --note "Checked: four is right for the sale"
cub variant promote api-live --change-order api-base/sale-4
cub release publish api-live --revision ChangeOrder:api-base/sale-4What you see with Argo CD already on the cluster, here v3.1.9:
cub cluster attach leaves that Argo CD in place.cub release list shows the running release Synced and Healthy.What you see with Flux already on the cluster (flux install):
cub cluster attach leaves Flux in place.oci.hub.confighub.com.To remove it:
cub cluster detach my-cluster disconnects the cluster from ConfigHub, and leaves the cluster as it is.my-cluster, my-cluster-argo-apps, argobot-my-cluster and argobot-base with cub space delete --recursive.argobot with cub component delete.argo-my-cluster with cub serviceaccount delete.Dan's team still reviews some changes as pull requests. The hub's copy can live in a Git repository of its own, written by the hub. A change merged there comes back into the hub, with the pull request's reason.
cub local copy api --variant live --to-dir shop-config # once: the hub's copy, at the root of a new repositorycd shop-config && git init -b main && git add -A && git commit -m "The hub's copy" && cd ..shop-config/api-live/api.yaml, is reviewed, and is merged.cub local copy --from-git shop-config --variant live --since FIRST-COMMITThe value is kept in the hub. Its reason is the commit's message, the commit, and its author. The cluster then runs it.
Replace FIRST-COMMIT with the hash of the commit made in step 2, "The hub's copy" (right after step 2, git -C shop-config log --format=%h -1 prints it). --since takes in every change committed after it. The commit taken in is recorded on the copy, so you need --since only the first time.
Each top-level folder of the repository is a Space. So the copy must be at the root of the repository, not in a subfolder.
For example, with Flux and no approval required for live, a merged change from 2 to 3 replicas is kept in the hub as "Three for the launch, reviewed in a pull request (Git, commit bb2beb3, by Dan)", and the cluster runs 3 replicas a few seconds later.
What runs keeps running. The controller holds the last release it pulled.
With Flux, while the hub is stopped:
We haven't tried this with Argo CD yet.
k8sbot reads, and makes one kind of write.
On the cluster cub cluster up --controller flux makes, k8sbot's service account has two ClusterRoles:
OCIRepository objects. Patching one is how k8sbot asks Flux to deploy.With Argo CD, k8sbot patches an Application's refresh annotation instead, as its own README describes.
cub cluster down shop --delete-configThis deletes the cluster, and its setup in the hub.