Skip to content
Back to Articles
GitOpsKubernetesFlux

Getting Started with GitOps: Managing AKS Clusters with Flux

May 22, 2024
14 min read

GitOps is the modern way to manage Kubernetes — using Git as the source of truth and automating deployments via pull-based flows. Flux CD is one of the most popular GitOps tools.

1. Introduction

Traditional CI/CD pushes manifests to clusters. GitOps reverses this using a pull model:

  • Git stores desired state
  • Flux synchronizes clusters
  • Drift is automatically corrected

2. Installing Flux

flux bootstrap github \
  --owner=myorg \
  --repository=cluster-config \
  --branch=main \
  --path=./clusters/prod

3. Folder Structure

clusters/
  prod/
    kustomization.yaml
    apps/
    infra/

4. Managing Applications

Use Kustomizations to deploy apps:

apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
metadata:
  name: api-service
spec:
  path: ./apps/api
  prune: true
  interval: 1m

5. Secrets Management

Integrate with:

  • SOPS + Azure Key Vault
  • Sealed Secrets
  • External Secrets Operator

6. Drift Detection

Flux automatically compares cluster vs Git and remediates drift.

7. Benefits of GitOps

  • Full audit trail
  • Secure pull-based deployments
  • No kubectl access needed
  • Automated rollbacks

8. Conclusion

Flux enables fully automated, auditable, and secure cluster management. Adopting GitOps is a natural evolution for modern AKS teams.