Prev Next

Maven / GitOps Interview Questions

How do you migrate an existing deployment pipeline to GitOps?

Migrating to GitOps is not a big-bang cutover — it works best as a phased process where the old pipeline and the GitOps operator run in parallel until confidence is established, then the old pipeline is decommissioned.

Step-by-step migration:

  1. Capture current state as declarative YAML: Export live Kubernetes resources with kubectl get all,configmap,secret,ingress -o yaml. Strip ephemeral fields (status, resourceVersion, uid, managed fields). This becomes your starting commit.
  2. Create the config repository: Organise manifests into an app folder structure with base + overlays (or Helm chart + values files). Commit the cleaned-up YAML. Add secrets using SOPS or Sealed Secrets before committing.
  3. Install the GitOps operator: Install Argo CD or Flux in the cluster. Keep the operator in dry-run or manual-sync mode initially.
  4. Connect operator to config repo: Create an Application or Kustomization CR pointing to the new config repo.
  5. Validate with dry-run: Confirm the operator produces manifests identical to what is currently running. Fix discrepancies in the config repo.
  6. Enable sync — manual first, then automated: Switch to manual sync. Run a few syncs from the UI or CLI. Observe. Then enable automated sync with prune: false initially (no deletions yet).
  7. Update CI to write to the config repo instead of kubectl:
# Replace: kubectl set image deployment/my-app my-app=${IMAGE}
# With: update the image tag in the config repo and push
- name: Promote image to config repo
  run: |
    cd gitops-config
    kustomize edit set image my-app=registry.example.com/my-app:${IMAGE_TAG}
    git add apps/my-app/overlays/prod/kustomization.yaml
    git commit -m "chore(cd): promote my-app ${IMAGE_TAG} to prod"
    git push origin main
  1. Revoke direct cluster write access: Remove kubeconfig from the CI system. Update RBAC to deny write access to any service account not owned by the GitOps operator.
  2. Enable prune: Once the team is comfortable, enable prune: true so deleted manifests are removed from the cluster.
What is the recommended first step when migrating an existing Kubernetes workload to GitOps?
After the GitOps operator is managing deployments, what must be removed from the CI/CD system to fully commit to the GitOps model?

Invest now in Acorns!!! 🚀 Join Acorns and get your $5 bonus!

Invest now in Acorns!!! 🚀
Join Acorns and get your $5 bonus!

Earn passively and while sleeping

Acorns is a micro-investing app that automatically invests your "spare change" from daily purchases into diversified, expert-built portfolios of ETFs. It is designed for beginners, allowing you to start investing with as little as $5. The service automates saving and investing. Disclosure: I may receive a referral bonus.

Invest now!!! Get Free equity stock (US, UK only)!

Use Robinhood app to invest in stocks. It is safe and secure. Use the Referral link to claim your free stock when you sign up!.

The Robinhood app makes it easy to trade stocks, crypto and more.


Webull! Receive free stock by signing up using the link: Webull signup.

More Related questions...

What is GitOps and what core principles does it define? How does GitOps differ from traditional CI/CD pipelines? What is the 'single source of truth' principle in GitOps? What are the two GitOps deployment models: push-based vs pull-based? What is a GitOps operator and what role does it play? What is declarative infrastructure and why does GitOps require it? How does GitOps improve security and auditability compared to script-based deployments? What Git branching strategies are commonly used with GitOps? What is drift detection and how does a GitOps operator handle drift? What is the difference between GitOps and Infrastructure as Code (IaC)? What is Argo CD and how does it implement GitOps? How does Argo CD's sync process work — desired state vs live state? What are Argo CD Applications and ApplicationSets? How do you structure a GitOps repository — app-of-apps, environment folders, overlays? What is Flux CD and how does it differ from Argo CD? How does Flux's source-controller and kustomize-controller work together? How do you manage secrets in a GitOps workflow — Sealed Secrets, SOPS, External Secrets Operator? How do you handle multiple environments (dev/staging/prod) in a GitOps repo? How does image automation work in Flux for continuous delivery? What are Argo CD sync policies — automated vs manual — and sync waves? How do you roll back a deployment using GitOps? How do you integrate GitOps with a CI pipeline — separation of concerns? What is progressive delivery and how does it relate to GitOps — Argo Rollouts, Flagger? How do you handle Helm charts in a GitOps workflow? How do you use Kustomize overlays in a GitOps repository? How do you implement multi-cluster GitOps at scale? How does Argo CD handle RBAC and multi-tenancy? What are the Argo CD app-of-apps and ApplicationSet patterns and when do you use each? How do you implement GitOps for infrastructure provisioning with Crossplane and Cluster API? How do you observe and alert on GitOps sync failures in production? How do you manage database schema migrations in a GitOps workflow? How do you implement policy enforcement in a GitOps pipeline — OPA/Gatekeeper, Kyverno? What are the limitations and anti-patterns of GitOps? How do you migrate an existing deployment pipeline to GitOps? How does GitOps fit into a platform engineering strategy?
Show more question and Answers...

Testing

Comments & Discussions