Interview questions and model answers
"What is GitOps and why use it over CI pushing to the cluster?"
Git holds the declarative desired state and an agent in the cluster pulls and continuously reconciles it. Compared with CI running kubectl, the cluster doesn't expose credentials to CI, drift is detected and corrected, Git history is the audit log, rollbacks are a revert, and many clusters scale because each pulls its own config. CI still builds and tests; its output is a commit to the GitOps repo.
"Explain how Flux deploys a change end to end."
CI pushes the image and updates the tag in the GitOps repo. source-controller fetches the new commit into an artifact; kustomize-controller builds the overlay path, decrypts SOPS secrets, applies with server-side apply, prunes removed objects and waits on health checks; dependsOn ensures infrastructure is ready first; notification-controller posts the result to Slack. A webhook receiver can trigger the reconcile immediately.
"Flux or Argo CD?"
Both are mature CNCF projects. Argo CD has a strong UI, AppProjects and ApplicationSets and suits a central self-service platform. Flux is a lighter toolkit with native Helm releases, SOPS, image automation and Kubernetes RBAC-based tenancy, usually installed per cluster. I'd pick based on team needs such as a UI and central management — and if I've run one in production, I'd say so and explain what I'd miss from the other.
"How do you promote between environments?"
Environments are directories with overlays, not branches. CI updates dev automatically, image automation or CI PRs promote to staging, and production is a PR changing the prod overlay's tag, with required reviews and checks; Flux applies after merge. For risky services, Flagger or Argo Rollouts canaries with metric analysis.
"How do you handle secrets in GitOps?"
External Secrets Operator with AWS Secrets Manager via IRSA: only ExternalSecret references are in Git. SOPS with KMS where we need values in Git encrypted. Never plaintext; Sealed Secrets is an alternative.
"Someone needs an emergency hotfix directly in the cluster. What happens?"
Flux would revert it at the next reconcile. The right path is a fast PR; if we truly must patch live, we suspend the Kustomization or HelmRelease, apply the fix, then commit the same change to Git and resume — and record it in the incident timeline.
"A teammate deleted a folder in the GitOps repo and production services vanished. What now?"
Prune did exactly what Git said. Revert the commit to restore; Flux re-creates the objects. PVCs with Retain policies and external data survive; check stateful workloads. Afterwards: CODEOWNERS and required reviews on prod paths, CI checks that flag large deletions, prune-disabled annotations on critical objects, and maybe separate prod repo permissions.