DevOps Engineer interview question · Most asked
How do you implement GitOps for both infrastructure and applications?
Summary
Keep desired state in Git: infrastructure as code (Terraform/OpenTofu) applied through PR-driven pipelines with reviewed plans, and Kubernetes manifests reconciled by an in-cluster agent (Argo CD or Flux). Every change is a reviewed commit, environments are folders or repositories, and drift is detected and corrected automatically.
Longer Answer
Practical design: separate repositories or folders for platform components and applications, promotion between environments by pull request (changing an image tag or version in the next environment's folder), secrets referenced from a secret manager rather than stored in Git, and policy checks on pull requests. Infrastructure GitOps is usually push-based (CI runs Terraform after merge), while Kubernetes GitOps is pull-based.
Key Points
- Git as source of truth for infra and apps.
- Reviewed plans; in-cluster reconcilers.
- Promotion by pull request.
- Secrets referenced, not stored.
Deep dive: Terraform interview questions
More most-asked DevOps Engineer questions
- Design a CI/CD pipeline for a containerised microservice from commit to production.
- What are DORA metrics, and how would you use them without gaming them?
- How do you handle database schema migrations in an automated deployment pipeline?
- How do you handle secrets in CI/CD pipelines securely?
- What happens when you type a URL into a browser and press Enter?
- Your CI pipeline takes 45 minutes. How would you speed it up?
- How do you secure the CI/CD pipeline itself against supply-chain attacks?
- What does 'build once, deploy many' mean, and why does it matter?