World map

 

BM: Baca dalam Bahasa Melayu

World K7: Self-Driving

GitOps: the order board is a repo

You will learn: the four GitOps rules, and why Git should drive your cluster.

Checked with Kubernetes 1.37 on 31 Oct 2026

The problem

You are here: cluster kind-dev namespace default
The shop Deployment shows 1/1 ready. Its history has one revision with no note about who changed it. Terminal output: $ kubectl get deployment shop NAME READY UP-TO-DATE AVAILABLE AGE shop 1/1 1 1 37s $ kubectl rollout history deployment/shop deployment.apps/shop REVISION CHANGE-CAUSE 1 <none>

The file says 3 trays. The cluster runs 1. Someone typed a command at 2 a.m. Who? Why? The cluster keeps no note.

Watch

Tap each point on the timeline.

Tap each rule. Together they are GitOps: The order board is a Git repo. The cluster follows what Git says.: the order board is a Git repo.

Try it

Lunch rush is coming. Change the order in Git, not in the cluster. Set replicas to 4 and commit.

Change one line in Git and commit. Watch the cluster follow.

Git (the order board)

apps/shop/deployment.yaml

apiVersion: apps/v1
kind: Deployment
metadata:
name: shop
spec:
replicas: 3
# selector and template: same as before
image:
Show the whole file
apiVersion: apps/v1
kind: Deployment
metadata:
  name: shop
  namespace: shop
spec:
  replicas: 3
  selector:
    matchLabels:
      app: shop
  template:
    metadata:
      labels:
        app: shop
    spec:
      containers:
        - name: web
          image: ghcr.io/kedai-kancil/shop:1.4.0

Commits

  1. f89a8e9 Add shopin the cluster

Cluster · namespace shop

Sync: SyncedHealth: Healthy

Deployment shop: 3/3 ready · image 1.4.0

Manual change (drift)
syncPolicy:
  automated:
    selfHeal: true
Show the Argo CD Application
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
  name: shop
  namespace: argocd
spec:
  project: default
  source:
    repoURL: "https://github.com/kedai-kancil/gitops.git"
    path: apps/shop
    targetRevision: main
  destination:
    server: "https://kubernetes.default.svc"
    namespace: shop
  syncPolicy:
    automated:
      selfHeal: true
Nothing to do. Git and the cluster match.

Try it

Which of these follow the GitOps rules?

Drag a card into a box. Or tap the card, then tap the box.

      Predict

      Git says 3 trays. The cluster has 2. What does the GitOps helper do?

      Pick one answer.

      Check

      You want 5 trays. Build the GitOps way to ask for them, after editing the file.

      Tap the pieces in the right order.

      …

      You did it!

      You can now explain GitOps with its four rules.

      Go deeper (optional)

      GitOps also makes undo easy: git revert puts the old order back. The helper is a controller, like the Deployment controller, just watching Git. Real rep (optional): read the four principles on opengitops.dev. Then look at your Kedai Kancil repo. Which files already describe what you want?