Kubernetes interview question · Most asked
What is GitOps, and how do Argo CD or Flux implement it?
Summary
GitOps uses Git as the source of truth for desired cluster state: changes are made by pull request, and an in-cluster agent (Argo CD or Flux) continuously pulls the repository and reconciles the cluster to match, reporting and optionally correcting drift.
Longer Answer
Benefits: audit trail and review for every change, easy rollback (revert a commit), no CI system holding cluster-admin credentials (pull rather than push), and self-healing against manual changes. Typical setup: CI builds and pushes an image, then updates the image tag in the environment's manifests (or an image updater does it); Argo CD syncs.
Design points: repository structure (app repos versus config repos, environments as directories or branches), secrets (External Secrets, Sealed Secrets, SOPS), progressive delivery (Argo Rollouts, Flagger), and handling drift alerts rather than letting people kubectl edit in production.
Key Points
- Git as source of truth; pull-based agents.
- PR review, audit, easy rollback.
- No cluster credentials in CI.
- Plan repo layout and secrets.
More most-asked Kubernetes questions
- ConfigMaps and Secrets: how do they differ, and how should secrets really be handled?
- How does the scheduler place pods? Explain resource requests, node affinity, taints and tolerations.
- Describe the Kubernetes architecture: what runs on the control plane and what runs on the nodes?
- How do rolling updates work in a Deployment, and how do you roll back?
- Explain the Service types: ClusterIP, NodePort, LoadBalancer, ExternalName and headless.
- What happens, step by step, when you run kubectl apply for a Deployment?
- Deployment, StatefulSet, DaemonSet, Job and CronJob: when do you use each?
- What is the difference between resource requests and limits, and what are the QoS classes?