← All insightsIntegration

How to use Kubernetes with Argo CD

CodeWizard Engineering · 3 May 2025 · 3 min read · Intermediate

Kubernetes and Argo CD are a common pairing in a modern DevOps stack. Here is how they fit together and a practical way to wire them up.

Where Kubernetes fits

Kubernetes is a container orchestrator: you declare the desired state of your workloads in YAML and controllers continuously reconcile the cluster toward it, handling scheduling, scaling, healing and networking.

yaml
apiVersion: apps/v1
kind: Deployment
metadata: { name: web }
spec:
  replicas: 3
  selector: { matchLabels: { app: web } }
  template:
    metadata: { labels: { app: web } }
    spec:
      containers:
        - name: web
          image: ghcr.io/acme/web:1.0
          ports: [{ containerPort: 3000 }]
          resources:
            requests: { cpu: 100m, memory: 128Mi }
            limits:   { cpu: 500m, memory: 256Mi }
          readinessProbe:
            httpGet: { path: /healthz, port: 3000 }
---
apiVersion: v1
kind: Service
metadata: { name: web }
spec:
  selector: { app: web }
  ports: [{ port: 80, targetPort: 3000 }]

Where Argo CD fits

Argo CD is a Kubernetes controller that continuously compares the live cluster to manifests in Git and syncs any drift, giving you declarative, auditable, self-healing deployments.

yaml
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata: { name: web, namespace: argocd }
spec:
  project: default
  source:
    repoURL: https://github.com/acme/deploy.git
    targetRevision: main
    path: apps/web
  destination:
    server: https://kubernetes.default.svc
    namespace: web
  syncPolicy:
    automated: { prune: true, selfHeal: true }
    syncOptions: [CreateNamespace=true]

Making them work together

  • Set requests/limits and use the HorizontalPodAutoscaler for elastic workloads
  • Separate config (ConfigMap) from secrets and mount them, don't bake them in
  • Adopt app-of-apps to manage many Applications declaratively
  • Enable selfHeal + prune so the cluster always matches Git

Want this pairing set up properly, with docs and handover? That is exactly the kind of work CodeWizard's embedded senior engineers do - and both Kubernetes and Argo CD have active community groups you can join for free.

Like where this is going?

Get hands-on help from the engineers who write these posts.

Book a free consult