You inherit a cluster with dozens of resources created by hand and nobody knows what is needed. How do you bring it under GitOps?
IntermediateScenarioAdopting GitOps & Repo Design
Answer
Situation read → Unknown state; risk of deleting something important.
What I'd do →
- Export resources per namespace (
kubectl get ... -o yaml), strip status and server fields (kubectl neathelps), and commit as a starting point. - Create Applications per namespace or service with manual sync and no prune.
- Enable
orphanedResources: {warn: true}on the project to list what is still not in Git. - Iterate until diffs are empty and orphans are explained, then enable automation.
- Clean up: move hand-written YAML into proper Helm/Kustomize structure.
Why → Adopt first, refactor later; orphan warnings give you a to-do list.
Interview tip → Emphasize no prune until orphans are understood.
More on Adopting GitOps & Repo Design
Your team deploys with Jenkins running `kubectl apply` and wants to move to Argo CD without downtime. How do you migrate?IntermediateA startup with three services asks whether they need a separate config repo. What do you recommend?BeginnerA team wants a Git branch per environment (`dev`, `staging`, `prod`). How do you respond?IntermediateDevelopers keep running `kubectl edit` in production to "quickly fix" things. How do you stop it without blocking incident response?IntermediateYou must deploy one microservice to 4 environments with Helm. Which values structure do you choose?BeginnerYour config repo has 400 Applications in one monorepo and every commit triggers a refresh of everything. What do you change?Advanced