Delete it from Git and Argo CD still leaves it running
By default auto-sync neither prunes nor reverts manual kubectl edits, a caution that suits FDEs deploying across a customer's many clusters.
In brief
- Argo CD treats Git as the source of truth. The controller continuously compares the running state with Git and marks the application OutOfSync when they diverge.
- Each cluster is registered with a labeled Secret. An ApplicationSet using the cluster generator creates an Application for every cluster automatically, including ones just added.
- Default auto-sync is cautious: no prune, no self-heal. Whether to turn each on is a decision to settle with the customer.
Turn on auto-sync in Argo CD, remove a resource from Git, and that resource stays exactly where it was on the customer’s cluster, unless you have deliberately enabled prune. Someone editing production by hand with kubectl will not make auto-sync run again either, unless you have enabled self-heal.
Those two defaults reveal how Argo CD is designed: it reports drift first, and fixes it only when you allow it to.
For a forward deployed engineer, that is the right behavior. You are deploying into infrastructure you do not own, usually across several clusters, with plenty of other people touching it. So you need to understand what the tool does and does not do before you switch on any automatic mode.
Git is the truth, the cluster is a copy
The official documentation describes Argo CD as a declarative, GitOps continuous delivery tool for Kubernetes. A Git repository holds the desired state of the application. At its core is the application controller: it continuously compares the running state with the target state in Git, marks the application OutOfSync when they diverge, and can correct the drift itself if you configure it to.
Alongside the controller sits the API server, a gRPC/REST server that serves the Web UI, the CLI and CI/CD systems. It also manages repository and cluster credentials.
When should an FDE use it?
Take a customer with four clusters: dev, staging and two production clusters in two regions. You deploy the same inference service to all four. With scripts and kubectl, three weeks later it is easy for nobody to be sure which cluster is running which version.
The signals for Argo CD are fairly clear: two or more clusters, several people with write access, and a customer who wants to know who changed what. When every change goes through Git, the commit history becomes the change log. The OutOfSync view then shows where reality has drifted from that log.
If the customer’s security team asks about maturity, the quick answer is that Argo joined the CNCF on March 26, 2020 and reached Graduated status on December 6, 2022.
A minimal example: adding a fifth cluster without touching the manifest
Step one is to register clusters declaratively. Each cluster is a Kubernetes Secret, and the documentation requires that Secret to carry the label argocd.argoproj.io/secret-type: cluster. A minimal sketch looks like this:
apiVersion: v1
kind: Secret
metadata:
name: prod-eu
namespace: argocd
labels:
argocd.argoproj.io/secret-type: cluster
stringData:
name: prod-eu
server: https://<cluster-api-url>
config: |
{ "<credentials>": "..." }
Cluster credentials live in Secrets, just like repository credentials. So do not commit this file to Git in plaintext. Encrypt it before committing, or keep the credentials out of the repository and put them only on the cluster running Argo CD, following a security process the customer has approved.
Step two is to write an ApplicationSet. This feature lets a single manifest target many clusters. The cluster generator produces parameters automatically from the clusters declared in Argo CD, so four Secrets yield four Applications:
apiVersion: argoproj.io/v1alpha1
kind: ApplicationSet
metadata:
name: inference
namespace: argocd
spec:
generators:
- clusters: {}
template:
metadata:
name: 'inference-{{name}}'
spec:
project: default
source:
repoURL: https://git.example.com/customer/deploy.git
targetRevision: main
path: inference
destination:
server: '{{server}}'
namespace: inference
syncPolicy:
automated: {}
The line automated: {} enables auto-sync with the two cautious defaults described at the top: no prune, no self-heal. Now the customer opens a fifth cluster. You add one labeled Secret, leave the ApplicationSet untouched, and the new cluster picks up the deployment on its own.
That is why the documentation recommends ApplicationSet when bootstrapping new clusters. The alternative is app-of-apps, but the documentation states plainly that it is an admin-only tool. If you do not hold admin rights on the customer’s Argo CD, the choice is all but made for you.
Two defaults to settle with the customer
Back to the production cluster. Say that at 2 a.m. an on-call engineer uses kubectl to scale replicas from 3 to 6 to absorb load. The controller sees the cluster has drifted from Git and reports OutOfSync, but with self-heal off, changes on the cluster do not trigger auto-sync, so the 6 replicas stay put.
The story does not end there. Git still says 3 replicas, so by GitOps logic the next sync from Git, for instance when someone merges another commit or clicks Sync, reapplies the target state and takes the cluster back to 3 replicas.
That can happen while load is still high. With self-heal on, the cluster would be pulled back to 3 immediately, leaving almost no window at 6 replicas.
So the correct fix at 2 a.m. is a commit that changes the replica count in Git, not a kubectl command. Prune carries a similar trade-off. With prune on, a ConfigMap you delete from Git disappears from the cluster; with it off, the ConfigMap lingers as configuration litter.
You are not the one who decides these two flags. Start with both off, watch the OutOfSync list for about a week, then bring that data to a meeting with the platform team. Be direct about one more thing: Argo CD manages the credentials of every cluster it deploys to, so the cluster running Argo CD must be protected as the most sensitive asset in the system.
What are the common mistakes?
The most common is believing that deleting a file from Git also removes the resource from the cluster. With default auto-sync, it is still there. Before telling the customer something is “removed,” check the actual cluster or enable prune deliberately.
The second is assuming Argo CD will pull the cluster back when someone edits it by hand. Without self-heal, it only reports OutOfSync. If nobody watches that view, the drift can sit unnoticed for weeks, until an unexpected sync wipes it out.
The third is committing cluster Secrets with plaintext credentials to make the setup “fully GitOps.” The last is choosing app-of-apps without admin rights, then getting stuck mid-engagement waiting for permissions.
In what order should you learn it?
Start with a single Application on a single cluster, to see the comparison loop and the OutOfSync state with your own eyes. Next come the auto-sync flags, then registering clusters with Secrets, and finally ApplicationSet with the cluster generator. Each step adds exactly one new concept.
When reading FDE job descriptions, look for the terms GitOps, Argo CD and multi-cluster. On your CV, do not just write “used Argo CD.” Use your real numbers: how many clusters, and how adding a new cluster went from many manual steps to a single Secret.
On a customer site, people do not remember how fast you deployed. They remember that you could answer “what is running in production?” without SSHing into any machine.
Was this article useful?
Thanks for the feedback!