Adopt from Argo CD and Flux

Find the apps Argo CD and Flux deploy on a cluster, import them as deployments that only observe, review what Wardn would do differently, and cut each one over with nothing restarted and nothing deleted.

You can move a cluster from Argo CD or Flux to Wardn one app at a time, while the old tool keeps running. Wardn first imports each app as a deployment that only observes: it renders the app from the same repository, compares its render with what the tool applied, and changes nothing in the cluster. Once you have reviewed every difference, Wardn cuts the app over: it stops the tool for that app, takes over the objects in place, and removes the tool's own object while keeping everything it deployed. Until that last step you can release it back to the tool.

Nothing is imported or changed until you ask. Pods are not restarted and no object the tool deployed is deleted.

Before you start

  • The cluster is connected with an operator recent enough to scan, compare and cut over. An older one shows Upgrade the operator to compare.
  • To cut over, the operator needs the cutover role, which wardn cluster connect adds unless you pass --no-cutover. See The cutover role.
  • Wardn compares and applies as the service account wardn-deployer in the deployment's namespace. The operator never creates accounts or role bindings, so create it once per namespace:
kubectl create serviceaccount wardn-deployer -n storefront
kubectl create rolebinding wardn-deployer -n storefront \
  --clusterrole=admin --serviceaccount=storefront:wardn-deployer

Until it exists, the deployment shows Can't compare yet with these two commands for its namespace.

Find the apps

On connect and on request, the operator scans the cluster with read-only access for Argo CD and Flux, and reports every Argo CD Application, Flux Kustomization and Flux HelmRelease with the tool's version. The scan writes nothing.

The results show in the Argo CD or Flux section of the cluster's Overview, and on the cluster connect screen right after you connect. No section shows when neither tool is found. From the CLI:

wardn import scan --cluster prod-eu-1

Each app has one status:

StatusMeaning
ReadyWardn can render it as the tool does.
Needs reviewIt uses something Wardn treats differently, such as a config management plugin or a Helm hook. The note says what.
Waiting for clusterThe scan has not finished, or the cluster is not connected.
Not supportedWardn cannot render it yet. The note says why.

The compatibility check behind Needs review reads the app's repository for every difference listed on Compared with Argo CD and Flux, before you import anything.

Import

Select Import apps in the cluster's section, select the apps, and import them. Each becomes a Wardn app and a deployment on that cluster, owned by you, set to only observe. You return to where you started. Imported deployments show on Deployments under the Importing filter, each with an Observing card.

An app that follows HEAD imports as tracking the repository's default branch. An app already imported is shown as such and cannot be imported twice.

You need import:manage on the cluster to import, and import:read to see what was found. Agents cannot import.

Review the differences

An observing deployment is rendered from git like any other, but never applied. On each new snapshot, when you select Refresh, and every three minutes, the operator dry-runs Wardn's render as wardn-deployer and reports what the first apply would change, what a cutover would remove, and what the tool runs that the render lacks. Secret values never leave the cluster; only keyed fingerprints do.

Differences show on the deployment's Live diff tab, each with a review:

  • Expected: the tool's own markers (its tracking labels and annotations), replicas an autoscaler sets, and images pinned by digest that already run that digest. These never need a person.
  • Ignored: fields the tool already ignored (ignoreDifferences in Argo CD, drift ignore rules in Flux).
  • To review: anything else. Read it, give a reason, and Accept it. If the object changes later, the difference opens again.

Accepting needs import:accept. Agents cannot accept.

When nothing is open, the deployment is ready to cut over, and Cut over appears.

Cut over

Cut over opens the review page: the steps, the checks that must pass (Before it can run), and who must approve. The steps, for an Argo CD Application:

Stop Argo CD for this app. Turn off the Application's automated sync. For Flux, suspend the Kustomization or HelmRelease.

Wardn applies the reviewed render and takes ownership. Server-side apply as wardn-deployer, taking over the tool's field managers. Images keep the text they run with when the running digest is the pinned one, so no pod restarts. They stay that way through later deploys until something else of that workload changes; that deploy rolls it anyway, and pins the image by digest from then on.

Remove Argo CD's markers.

Remove the Application, keeping its resources. Only after the deletion-safety check below passes, then a check, twice, that every object it managed is still there with the same uid. A HelmRelease is removed differently; see Cutting over a HelmRelease.

Hook objects (Argo CD sync hooks, Helm hooks) are not applied during a cutover; they run with the next deploy.

Who cuts over

A person with import:cutover on the deployment starts it. The guardrails that govern releases govern a cutover: approvals, freezes, deploy windows, change tickets and open incidents hold it as they hold a deploy. Rules about where a snapshot qualified, how long it soaked and who signed it off do not apply: the shadow run is a cutover's qualification. When a guardrail asks for approvals, as production guardrails usually do, the cutover waits for them; the approval request shows the accepted differences, the deletion-safety check and the steps, and the person who asked cannot approve it.

Wardn cuts over automatically only when nothing is open, the deletion-safety check passed, no parent app or ApplicationSet has to change first, the guardrails ask for no approval, and the deployment is not in production. A deployment on a cluster in no environment counts as production for this rule. This is a fixed rule, not a setting.

Just before its first write, the cutover judges the guardrails again. If a freeze began since it was approved, it waits (Waiting · the guardrails hold it now) and goes on once they let it.

While a cutover runs, the deployment's settings and apps cannot be changed and it cannot be deleted.

Deletion safety

Wardn removes the tool's object only when the operator proves the removal keeps what it deployed:

  • the controller runs a version Wardn has proven, on a kind cluster, to orphan on removal: Argo CD 3.6 from 3.6.1, Flux's kustomize-controller 1.9 from 1.9.6, and Flux's helm-controller 1.6 from 1.6.5 (the one Flux 2.9 ships). For an Application an ApplicationSet generates, the ApplicationSet controller must run a proven version too: it is the one that removes the Application;
  • the operator can patch and delete the object;
  • no parent app still applies it. For an app of apps, the cutover waits until the child leaves the parent (Waiting for flux-system to let go), with steps 1 to 3 done.

Any other version waits with the version named. A removal whose check fails deletes nothing and waits; you can release it back.

Cut over an ApplicationSet's Application

An ApplicationSet's controller overwrites any edit to an Application it generates within seconds, and recreates one that is deleted while the set still generates it. So Wardn cannot stop such an Application, or delete it, on its own. Wardn never writes an ApplicationSet. You make two changes to it, in its repository, and Wardn does the rest.

First, add one rule for this Application. It tells the controller to leave alone the fields Wardn changes on that Application, and nothing on the others the set generates. Add it under spec of the ApplicationSet, with the Application's name (here storefront):

spec:
  ignoreApplicationDifferences:
    - name: storefront
      jsonPointers:
        - /spec/syncPolicy/automated
        - /metadata/finalizers
        - /metadata/annotations/wardn.dev~1cutover
        - /metadata/annotations/wardn.dev~1cutover-before
        - /metadata/annotations/wardn.dev~1cutover-released

Without it, Before it can run shows ApplicationSet lets Wardn stop this app as Needed, with the rule Wardn still misses, and the cutover cannot start. A rule that already covers some of these fields, such as /spec/syncPolicy or /metadata/annotations for this Application or for all of them, counts for them; a rule written as jqPathExpressions is never counted. Only the Application named is affected, and the rule can stay or go afterwards.

Then run the cutover. Wardn stops the Application, takes over what it deployed, and arms the ApplicationSet's own delete: it removes the Application's deletion finalizers and checks, after the ApplicationSet controller had time to put anything back, that the rule holds. The cutover then waits (Waiting for fleet to let go), with steps 1 to 3 done. Do not change the generator before this wait: with the finalizers on, the ApplicationSet's delete would remove what the Application deployed.

Last, stop the ApplicationSet generating the Application. Change the generator so it no longer produces it:

  • a list generator: remove the element;
  • a Git directory generator: add the directory with exclude: true. Do not delete the directory, which is usually the Application's own path, and Wardn deploys from it;
  • a Git file generator: remove the entry from the file;
  • a cluster generator: change the cluster's label or the selector, which removes every Application the set generates for that cluster, so check which ones;
  • a matrix, merge, SCM provider, pull request or plugin generator: change it so the Application is no longer produced.

The ApplicationSet then removes the Application, without its finalizers, so Argo CD deletes nothing it deployed. Wardn sees it gone, checks twice that every object it managed is still there with the same uid, and finishes. Wardn never deletes the Application itself, and writes nothing to the ApplicationSet or to the other Applications it generates.

Things to know:

  • You can release the cutover back until the ApplicationSet removes the Application. A release puts auto-sync back and leaves the deletion finalizers off, since Wardn cannot tell whether you already changed the generator; put the Application back in the generator if you did. Argo CD then deletes nothing if the ApplicationSet removes the Application later.
  • If the controller puts back a field Wardn changed, because the rule does not hold on your version, the cutover is refused or interrupted before anything is lost, and you can release it back.
  • If you put the Application back in the generator after it was removed, the ApplicationSet generates a new one. Wardn writes nothing to it and reports it; remove it from the generator again, or delete the Wardn deployment.
  • An ApplicationSet whose applicationsSync policy (or its controller's --policy) is create-only or create-update never deletes the Applications it stops generating, so Wardn cannot tell when one is let go: it is not supported yet, as is one with strategy: RollingSync, which syncs in steps. An ApplicationSet that is being deleted is refused.
  • Every change of the Application makes the ApplicationSet reconcile all the apps it generates. A cutover makes a few, never repeatedly.
  • Setting preserveResourcesOnDeletion: true on the ApplicationSet makes Argo CD keep the resources of every Application it deletes, which protects the sibling Applications from a change to the generator that is wider than you meant. It changes deletion for the whole set, so Wardn does not ask for it.

Cutting over a HelmRelease

Flux's helm-controller has no mode that keeps what a HelmRelease deployed. Deleting a HelmRelease runs helm uninstall, which deletes the release's objects. So the cutover never relies on a setting of the HelmRelease; it makes the delete harmless in two ways, and the removal needs both:

  • It suspends the HelmRelease in step 1. helm-controller skips the uninstall when it deletes a suspended HelmRelease. Step 1 also waits for a reconcile that was already running, since suspending does not stop one, and refuses a release that ends it in a state other than deployed.
  • It removes the HelmRelease's finalizer (finalizers.fluxcd.io) in step 4, then reads the object once more and deletes it only if it is still suspended with no finalizer, with the uid and resourceVersion it read as preconditions. If helm-controller put the finalizer back in between, the delete fails and nothing is deleted; Wardn strips it again and tries again.

Wardn proves this for each helm-controller version on a real controller: the release's objects, pods and Helm records keep their uids, nothing restarts, and the uninstall's pre-delete hook never runs. A version it has not proven waits, with the version named.

A HelmRelease is refused, with the reason on the review page, when:

  • its latest release is not deployed (failed, pending an install, upgrade or rollback, or uninstalled), because what runs is then not what the release says. It clears when Flux deploys the release;
  • it sets spec.kubeConfig, so its release lives on another cluster;
  • it is applied by another HelmRelease or a Helm release. A Flux Kustomization may apply it, as flux-system does after bootstrap; the cutover then waits for it to let go, exactly as for a Kustomization.

What Wardn leaves alone. Helm keeps a release's records as Secrets named sh.helm.release.v1.<release>.v<N>, in the namespace the HelmRelease stores them in (its own, unless spec.storageNamespace says otherwise, often not the app's namespace). Wardn never reads, writes or deletes them, and its role has no access to Secrets there. It also leaves the HelmChart object helm-controller made for the release, which stays harmless.

After the cutover:

  • helm ls and helm history still show the release as deployed. The records are Flux's last state and are never changed.
  • Do not run helm uninstall, helm rollback or helm upgrade on it. uninstall and rollback act on the records' stored manifest, and would delete or overwrite what Wardn now owns.
  • To tidy helm ls, delete the records, not the release: kubectl delete secret -n <storage namespace> -l owner=helm,name=<release>. They hold the release's values and manifest, exactly as sensitive as before.
  • To remove the leftover HelmChart: kubectl delete helmchart -n <namespace of the HelmRelease> <namespace>-<name>.
  • Do not create the HelmRelease again. Flux would try to upgrade the release over objects Wardn owns, and Helm refuses it because Wardn removed its ownership annotations.

What the comparison can and cannot tell. The comparison checks the output: Wardn's render of the chart and values against the live objects. A different chart version, or values Wardn does not have, show as differences. Values that come from a ConfigMap or Secret (valuesFrom) are not carried; if they matter the render differs, and accepting the difference applies the render without them. A chart that calls lookup renders without a cluster, so Secrets it generates differ, and accepting such a difference rotates the value at the cutover. Hooks of the chart are not applied by a cutover, and its delete hooks never run.

If other Flux objects dependsOn the HelmRelease, they keep what they deployed but wait forever for a dependency that no longer exists once it is removed. Change their dependsOn first or right after.

What cannot be cut over yet

These import and observe, but cannot be cut over:

  • a Flux HelmRelease whose release is not deployed, or lives on another cluster;
  • an Application that manages itself;
  • an Application an ApplicationSet generates, unless its ApplicationSet deletes the apps it stops generating, syncs them all at once, and carries the rule in Cut over an ApplicationSet's Application (an ApplicationSet whose policy is create-only or create-update, or that syncs in steps, is not supported yet);
  • a parent of the other tool's apps, or an app a HelmRelease or the argocd-apps chart installs;
  • an app that deploys into Argo CD's or Flux's own namespace;
  • a Flux Kustomization that deploys to another cluster (spec.kubeConfig).

An Argo CD that deploys to another cluster can be cut over; see Argo CD on another cluster.

Argo CD on another cluster

A hub-and-spoke setup has one Argo CD, on the hub, that deploys to other clusters, the spokes, through cluster secrets. Wardn cuts such an app over as long as both clusters are connected to Wardn, in one organization, with operators that can cut over between clusters (update the operator on either if the check says so).

Which Wardn cluster an Argo CD destination is. Wardn never reads Argo CD's cluster secrets, which hold the hub's credentials for every spoke. A destination named like a Wardn cluster is matched by itself. For any other, say it yourself:

wardn import link --from hub-1 --destination eks-prod-eu-1 --to eu-west

This needs import:manage on both clusters, the hub is scanned again, and the app moves from Waiting for cluster to ready. --remove takes the link away. A link authorizes nothing by itself: importing needs your rights on both clusters, and the cutover proves the match itself, as below.

What runs where. The hub's operator checks the Application, stops Argo CD for this app and, last, removes the Application. The spoke's operator reads the objects Argo CD lists, takes them over as wardn-deployer, and checks that every one survived. Nothing restarts and nothing is deleted. Before the first write on the spoke, Wardn checks that the objects Argo CD lists exist there and carry the Application's markers: finding none, or one that belongs to another Application, ends the attempt with nothing written there. Argo CD is read back as stopped on the hub before each write on the spoke, and if the Application is re-pointed at another cluster the cutover stops.

Who may cut over. import:cutover on the deployment and on the hub cluster, since cutting over stops its Argo CD and removes its Application. A freeze or deploy window on the hub's environment holds the cutover as well as the spoke's.

If a cluster goes offline. The cutover waits and says which cluster it waits for. It never turns Argo CD back on by itself: with the spoke offline, Argo CD stays stopped for this one app until the spoke is back. A release back restores the spoke first, then resumes Argo CD on the hub.

The hub's operator holds a strong permission. To stop an Application and remove it, the operator on the hub may patch and delete Applications, and what an Application says decides what Argo CD applies to every spoke it holds credentials for. Wardn's code allows it only the one Application of a cutover, by uid, but the permission is the strongest wardn cluster connect asks for. It is granted only on a cluster that runs Argo CD or Flux, and --no-cutover leaves it out. After the last app of a spoke is cut over, remove that cluster from Argo CD too: Wardn doesn't touch its credentials.

Not yet. Apps an ApplicationSet generates, which is how most hub-and-spoke fleets create their Applications, are still refused; so is Flux with spec.kubeConfig. Removal is proven for a remote destination on Argo CD 3.6 from 3.6.1; other versions wait with the version named. The deletion-safety check of the Application is made by the hub when the cutover starts, before anything is written, not shown beforehand in Before it can run.

Release back

Until the tool's object is removed, Release back to Argo CD (or Flux) puts back exactly what Wardn changed: the sync setting, the markers, the field managers, and deletes only the objects the cutover created. A field someone changed since is left as it is and reported. The deployment observes again, and automatic cutover stays off for it.

If someone turns the tool back on during a cutover, Wardn writes nothing more and the attempt is Interrupted. Release it back, or select Cut over again, which stops the tool again only if its spec is otherwise unchanged. An attempt can be cut over again five times.

For a HelmRelease, release back puts back its suspend, its finalizer and its annotations, and asks Flux to reconcile. What Flux then does depends on the HelmRelease. With driftDetection.mode: enabled it puts its own version of what Wardn changed back at once, and pods whose template Wardn changed restart. Without it, Flux leaves what Wardn changed until its next release of the chart; the review says which applies. The release's records were never touched, so its history continues from the same revision.

After removal there is nothing to release back to. If an object did not survive the removal, Wardn applies the approved snapshot again, marks the attempt failed and notifies the team. A HelmRelease Wardn removed is not recreated; to go back to Flux, delete the Wardn deployment and install the app with Flux again.

Coexistence

Wardn and the old tool never own one object. An ordinary deployment whose render holds an object Argo CD or Flux manages is refused before anything is applied, and Wardn's prune leaves alone an object another tool took over.

Permissions

PermissionLets you
import:readSee what the scan found and an import's state.
import:manageScan and import a cluster's apps, and link an Argo CD destination to a cluster (on both).
import:acceptAccept a difference with a reason.
import:cutoverCut over, cut over again and release back; for Argo CD on another cluster, on both clusters.

None of them can be given to agents.

On this page