Video in progress
How do you choose between GitOps (Argo CD or Flux) and deploying straight from CI with kubectl/helm?
In GitOps the cluster state is pulled from Git: audit, drift correction and not giving CI cluster rights are its strengths. Push deploy is simpler, and controlling the sequence inside a pipeline is easy. With many clusters and many teams, GitOps usually wins.
📖 Answer
The push model: CI runs helm upgrade. It is clear and visible in one place. The problems show up with scale:
- an admin token for the prod cluster sits on the CI runner. That is the most valuable secret, and it is in every pipeline;
- if someone changes something by hand with
kubectl edit, nobody knows: drift; - the answer to "what is running in prod right now?" is the cluster itself, not Git.
GitOps (pull): an agent inside the cluster watches the manifests in Git and reconciles the state. Git is the source of truth.
- a deploy is a PR merge, so audit and review come automatically;
- CI does not need cluster rights, only write access to Git;
- drift is reverted automatically, or at least visible;
- disaster recovery: you install Argo CD on a new cluster and point it at the same repo.
The pain points of GitOps:
- "did the deploy finish, and did it succeed?" is not visible in CI, and you have to get the status from Argo. Sequential steps (deploy → smoke test → next region) need extra orchestration;
- secrets cannot live in Git, so External Secrets or Sealed Secrets are added;
- there are many commits in the environment repo, so updating the image tag has to be automated;
- subtle cases with Helm hooks and CRDs.
My decision is usually: with more than 2-3 clusters and several teams, GitOps, with the app manifests in a separate "environment" repo. With one cluster and a small team, push is enough, and switching later is not hard if the manifests live in Git anyway.
Sign up to mark studied questions and save your progress.