How would you promote a change from staging to production in GitOps?
CI/CD & GitOps · Intermediate level
Answer
Promotion from staging to production should be a controlled Git change. The pipeline promotes the same artifact digest or version, updates the production manifest or values file, opens a pull request, runs policy checks, gets approval, and lets Argo CD sync production.
Technical explanation
The desired state should be declarative enough for an agent to converge without manual runbook steps.
Git history becomes the audit trail for who requested, reviewed, and approved an environment change.
GitOps separates build from deploy: CI produces immutable artifacts, while the GitOps controller reconciles declarative desired state into the cluster.
Argo CD status has two dimensions: sync status indicates desired versus live state; health status indicates whether live resources appear operationally healthy.
Use projects, RBAC, repository allowlists, destination restrictions, sync windows, and admission policies to constrain what an Application may deploy.
Prefer reviewed Git changes over direct kubectl changes; direct changes create drift and bypass audit, policy, and promotion workflow.
Hands-on example
1. Model the desired state for: How would you promote a change from staging to production in GitOps in a GitOps repository, for example environments/staging/apps/payments and environments/prod/apps/payments.
2. Keep common manifests in base/ and environment differences in overlays or values-dev.yaml, values-staging.yaml, and values-prod.yaml; production changes require a separate PR and approval.
3. Open a pull request that changes only the desired version or values, require review and policy checks, then merge to let Argo CD detect OutOfSync state.
4. Run argocd app get payments and argocd app diff payments, then sync manually or let automated sync reconcile; verify sync status, health status, events, and Kubernetes rollout status.
5. Test rollback by reverting the Git commit or promoting the previous artifact digest, then watch Argo CD reconcile the cluster back to the known-good desired state.
Check how well your resume matches the role with our free resume checker— match score, ATS check, and the skills you're missing.
More CI/CD & GitOps interview questions
- How do you structure Git repositories for GitOps (mono vs multi, app vs config repo)?
- What is GitHub Enterprise, and how does it differ from github.com?
- What are the advantages of pull-based deployment for security?
- What is the difference between GitHub Actions and Jenkins?
- How do you prevent configuration drift from manual kubectl changes with ArgoCD?
- What is a GitHub Actions workflow, job, step, and runner?
- How do you roll back a bad change in a GitOps workflow?
- What is the difference between a GitHub-hosted and a self-hosted runner?