← All articles

GitOps & Kubernetes

Use Argo CD to make deployment state visible

A GitOps workflow works when the repository, reconciliation policy and application health tell the same story.

A Git repository sends desired state to Argo CD, which reconciles a Kubernetes cluster and reports status.
An illustrative model for the ideas discussed in this article.

Argo CD gives a Kubernetes team a clear answer to a basic question: what does Git say should be running, and how does that compare with the cluster? That answer is useful only when the repository path, target environment and sync policy are easy to understand.

Keep the deployment source reviewable

Build an immutable application image in CI, then update the deployment repository with its image digest or a registry-enforced immutable tag. Argo CD can observe that desired state and reconcile the cluster. The build workflow does not need direct access to the Kubernetes API just to trigger a deployment.

A small Application definition makes the boundary visible:

apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
  name: example-api
  namespace: argocd
spec:
  project: default
  source:
    repoURL: https://git.example.org/platform/workloads.git
    targetRevision: main
    path: apps/example-api/overlays/production
  destination:
    server: https://kubernetes.default.svc
    namespace: example-api
  syncPolicy:
    automated:
      selfHeal: true
      prune: false
    syncOptions:
      - CreateNamespace=true

Use a protected branch or reviewed pull request for the production path. Keep credentials and generated values out of Git, and make the link between a release and the manifest change easy to follow.

Choose automation deliberately

Automated sync can remove a fragile deployment hand-off: CI changes Git, and Argo CD performs the reconciliation. The self-heal option asks Argo CD to bring drifted live state back towards Git. Pruning is a separate decision because it allows resources removed from Git to be deleted from the cluster.

Start with the least surprising policy for your application. Enable automatic pruning only after the repository structure, ownership boundaries and review process make deletions safe. Check the Argo CD automated sync documentation for the behaviour of each option.

Health is more than Synced

“Synced” means the live resources match the desired manifests. It does not, by itself, prove that users can complete a request or that a service can tolerate node maintenance. Include readiness and service-level signals in rollout decisions.

For replicated workloads, set resource requests and plan how many instances can be unavailable during voluntary maintenance. A PodDisruptionBudget can help coordinate evictions, but it does not replace enough replicas, capacity to reschedule them or application-level health checks.

Make the reconcile loop easy to debug

Keep application ownership clear, use meaningful names and labels, and make the path from an alert to the responsible manifest short. When a sync fails, teams should be able to see which commit was applied, which resource is unhealthy and what action is safe to take.

GitOps is not “put YAML in Git and walk away.” It is an operating model: reviewed desired state, a controller that reports drift and a team that understands how to recover when the two disagree.

For a repeatable way to package workloads and target them across clusters, see how Helm and ApplicationSet generators work together.