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 →
- Create a config repo (or folder) holding rendered or Helm/Kustomize manifests per environment.
- Install Argo CD and create Applications with auto-sync off; check the diff against what's live.
- Fix the diffs: defaulted fields, HPA-managed
replicas(useignoreDifferences), and objects created by hand. - 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
- 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.
More on Migrations
Migrate an application from EC2 to EKS with zero downtime. Walk me through it.AdvancedMigrate a database from on-prem MySQL to Amazon RDS with minimal downtime. How?AdvancedYou need to move Terraform state from local files to an S3 backend. How?BeginnerMigrate CI from Jenkins to GitHub Actions for 80 repositories. How do you plan it?IntermediateUpgrade an EKS cluster from 1.30 to 1.31 in production. What's your process?IntermediateMove from a monolith to microservices. What's the DevOps side of the migration?Advanced