EN: Read in English
Dunia K7: Pandu Sendiri
GitOps: papan pesanan ialah repo
Anda akan belajar: empat peraturan GitOps, dan kenapa Git patut pandu kluster anda.
Teks BM belum disemak oleh penutur asli.
Disemak dengan Kubernetes 1.37 pada 31 Okt 2026
Masalahnya
kind-dev namespace defaultFail itu minta 3 dulang. Kluster jalankan 1. Seseorang taip arahan pukul 2 pagi. Siapa? Kenapa? Kluster tak simpan sebarang nota.
Tengok
Ketik setiap titik pada garis masa.
Tekan setiap peraturan. Bersama-sama, ia dipanggil GitOps: Git jadi sumber kebenaran; kluster ikut apa yang ada dalam Git.: papan pesanan ialah repo Git.
Cuba
Waktu puncak hampir tiba. Tukar pesanan dalam Git, bukan dalam kluster. Tetapkan replicas kepada 4, kemudian commit.
Tukar satu baris dalam Git dan commit. Lihat kluster mengikutnya.
Git (papan pesanan)
apps/shop/deployment.yaml
Tunjuk seluruh fail
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
Commit
f89a8e9Add shopdalam kluster
Kluster · namespace shop
Sync: SyncedHealth: Healthy
Deployment shop: 3/3 sedia · image 1.4.0
syncPolicy:
automated:
selfHeal: trueTunjuk Application Argo CD
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
Petunjuk
Tekan + sekali, kemudian Commit ke Git.Cuba
Yang mana ikut peraturan GitOps?
Seret kad ke dalam kotak. Atau ketik kad, kemudian ketik kotak.
Teka
Git tulis 3 dulang. Kluster ada 2. Apa pembantu GitOps buat?
Pilih satu jawapan.
Semak
Anda mahu 5 dulang. Selepas edit fail, bina cara GitOps untuk memintanya.
Ketik kepingan ikut turutan yang betul.
Anda berjaya!
Kini anda boleh terangkan GitOps dengan empat peraturannya.
Nak tahu lebih (pilihan)
GitOps juga mudahkan undur: git revert kembalikan pesanan lama. Pembantu itu ialah controller, sama macam controller Deployment, cuma ia pantau Git. Latihan sebenar (pilihan): baca empat prinsip di opengitops.dev. Kemudian lihat repo Kedai Kancil anda. Fail mana yang dah terangkan apa yang anda mahu?
English
The file says 3 trays. The cluster runs 1. Someone typed a command at 2 a.m. Who? Why? The cluster keeps no note.
Tap each rule. Together they are GitOps: the order board is a Git repo.
Lunch rush is coming. Change the order in Git, not in the cluster. Set replicas to 4 and commit.
Which of these follow the GitOps rules?
Git says 3 trays. The cluster has 2. What does the GitOps helper do?
You want 5 trays. Build the GitOps way to ask for them, after editing the file.
You can now explain GitOps with its four rules.
Anda dah siapkan ini. Latihan lagi pun bagus!
Dokumentasi rasmi: OpenGitOps: the four principles · Argo CD: core concepts · Flux: core concepts
Anda dah belajar 25 minit. Rehat sekejap bantu otak anda.
Pecutan selesai! Fokus yang hebat. Regangkan badan seminit?