GitOps with ArgoCD: why Git is the source of truth
GitOps is a simple idea with a strict rule: the desired state of your cluster lives in Git, and nothing else is allowed to change it. If a change is not in Git, it does not exist. I run a two-node k3s cluster on Oracle Cloud this way. Without it, a cluster becomes a pile of commands somebody once typed into a terminal.
The problem GitOps solves is drift. A cluster changes all the time: someone scales a deployment by hand during an incident, a dashboard edit tweaks a resource, a Helm upgrade leaves a value behind. None of those changes are recorded anywhere. Six months later, nobody can say why the cluster looks the way it does, and rebuilding it is impossible because the real configuration only exists inside the cluster. GitOps turns that around. ArgoCD watches a Git repository and continuously compares it with the live cluster. When they differ, ArgoCD shows the drift and, depending on how you configure it, syncs it back. The repository becomes the one place you can read to know what should be running.
The workflow is ordinary Git workflow, and that is the point. A change is a pull request. Somebody reviews it. It merges, ArgoCD notices, and the cluster moves to the new state. A bad change is a revert, and the revert is itself a reviewed change. There is no separate deployment step to forget, and no one needs cluster credentials to ship a change — they need repository access and a review. That separation matters for security too: the cluster only ever pulls from Git, so a compromised laptop cannot push straight into production.
On my own platform I use the app-of-apps pattern. One root ArgoCD application points at a repository folder, and it creates the child applications: cert-manager for TLS, External Secrets for secrets, the monitoring stack, Velero for backups, and the application workloads. Adding a new component is adding a file to Git, not running a command. A daily GitHub Actions job checks for drift, so even a change that ArgoCD would sync away gets noticed and recorded.
Secrets deserve a special note, because they are the one thing that must never go into Git. I keep them in OCI Vault and deliver them into the cluster with the External Secrets Operator. Git holds the reference — which secret, from where — and the value never appears in a repository. If you put a password in Git, assume it is public forever.
GitOps is not magic. It will not fix a bad application, and it will not stop you from merging a bad manifest. What it gives you is a record: every change has an author, a review, and a time. When something breaks at 2 a.m., you do not guess what changed. You read the log, find the commit, and revert it. That is the whole argument. The cluster is a machine; Git is its memory.