Today CI runs `kubectl apply` directly against production. You're asked to move to GitOps with Argo CD. How do you migrate?

IntermediateScenarioMigrations
Answer

Situation read → Push-based CI holds cluster credentials and leaves no single source of truth. The migration has to avoid Argo CD "fighting" with the existing pipeline.

What I'd do →

  1. Create a config repo (or folder) holding rendered or Helm/Kustomize manifests per environment.
  2. Install Argo CD and create Applications with auto-sync off; check the diff against what's live.
  3. Fix the diffs: defaulted fields, HPA-managed replicas (use ignoreDifferences), and objects created by hand.
  4. Change CI: build, push the image, then commit the new tag to the config repo instead of running kubectl.
cd gitops && yq -i '.image.tag = "'"$GIT_SHA"'"' apps/checkout/values-prod.yaml
git commit -am "checkout: deploy $GIT_SHA" && git push
  1. Turn on auto-sync, then self-heal, service by service. Remove the CI cluster credentials last.

Why → Doing it per service, with sync off first, means nothing gets overwritten or pruned unexpectedly.

Interview tip → Mention removing CI's cluster-admin credentials; that's the security win interviewers look for.

All Real-World Interview questions Roadmap: Interview readiness

More on Migrations