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

← All DevOps Engineer questions