@xdev-asia/xdev-knowledge-mcp 1.0.44 → 1.0.45

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (36) hide show
  1. package/content/series/luyen-thi/luyen-thi-cka/chapters/01-cluster-architecture/lessons/01-kien-truc-cka-kubeadm.md +133 -0
  2. package/content/series/luyen-thi/luyen-thi-cka/chapters/01-cluster-architecture/lessons/02-cluster-upgrade-kubeadm.md +147 -0
  3. package/content/series/luyen-thi/luyen-thi-cka/chapters/01-cluster-architecture/lessons/03-rbac-cka.md +152 -0
  4. package/content/series/luyen-thi/luyen-thi-cka/chapters/02-workloads-scheduling/lessons/04-deployments-daemonsets-statefulsets.md +186 -0
  5. package/content/series/luyen-thi/luyen-thi-cka/chapters/02-workloads-scheduling/lessons/05-scheduling-taints-affinity.md +163 -0
  6. package/content/series/luyen-thi/luyen-thi-cka/chapters/03-services-networking/lessons/06-services-endpoints-coredns.md +145 -0
  7. package/content/series/luyen-thi/luyen-thi-cka/chapters/03-services-networking/lessons/07-ingress-networkpolicies-cni.md +172 -0
  8. package/content/series/luyen-thi/luyen-thi-cka/chapters/04-storage/lessons/08-persistent-volumes-storageclass.md +159 -0
  9. package/content/series/luyen-thi/luyen-thi-cka/chapters/05-troubleshooting/lessons/09-etcd-backup-restore.md +149 -0
  10. package/content/series/luyen-thi/luyen-thi-cka/chapters/05-troubleshooting/lessons/10-troubleshooting-nodes.md +153 -0
  11. package/content/series/luyen-thi/luyen-thi-cka/chapters/05-troubleshooting/lessons/11-troubleshooting-workloads.md +146 -0
  12. package/content/series/luyen-thi/luyen-thi-cka/chapters/05-troubleshooting/lessons/12-troubleshooting-networking-exam.md +170 -0
  13. package/content/series/luyen-thi/luyen-thi-cka/index.md +1 -1
  14. package/content/series/luyen-thi/luyen-thi-ckad/chapters/01-app-design-build/lessons/01-multi-container-pods.md +146 -0
  15. package/content/series/luyen-thi/luyen-thi-ckad/chapters/01-app-design-build/lessons/02-jobs-cronjobs-resources.md +174 -0
  16. package/content/series/luyen-thi/luyen-thi-ckad/chapters/02-app-deployment/lessons/03-rolling-updates-rollbacks.md +148 -0
  17. package/content/series/luyen-thi/luyen-thi-ckad/chapters/02-app-deployment/lessons/04-helm-kustomize.md +181 -0
  18. package/content/series/luyen-thi/luyen-thi-ckad/chapters/03-app-observability/lessons/05-probes-logging-debugging.md +183 -0
  19. package/content/series/luyen-thi/luyen-thi-ckad/chapters/04-app-environment-config/lessons/06-configmaps-secrets.md +182 -0
  20. package/content/series/luyen-thi/luyen-thi-ckad/chapters/04-app-environment-config/lessons/07-securitycontext-pod-security.md +168 -0
  21. package/content/series/luyen-thi/luyen-thi-ckad/chapters/04-app-environment-config/lessons/08-resources-qos.md +168 -0
  22. package/content/series/luyen-thi/luyen-thi-ckad/chapters/05-services-networking/lessons/09-services-ingress.md +182 -0
  23. package/content/series/luyen-thi/luyen-thi-ckad/chapters/05-services-networking/lessons/10-networkpolicies-exam-strategy.md +236 -0
  24. package/content/series/luyen-thi/luyen-thi-ckad/index.md +1 -1
  25. package/content/series/luyen-thi/luyen-thi-kcna/chapters/01-kubernetes-fundamentals/lessons/01-kien-truc-kubernetes.md +137 -0
  26. package/content/series/luyen-thi/luyen-thi-kcna/chapters/01-kubernetes-fundamentals/lessons/02-pods-workloads-controllers.md +142 -0
  27. package/content/series/luyen-thi/luyen-thi-kcna/chapters/01-kubernetes-fundamentals/lessons/03-services-networking-storage.md +155 -0
  28. package/content/series/luyen-thi/luyen-thi-kcna/chapters/01-kubernetes-fundamentals/lessons/04-rbac-security.md +137 -0
  29. package/content/series/luyen-thi/luyen-thi-kcna/chapters/02-container-orchestration/lessons/05-container-runtimes-oci.md +137 -0
  30. package/content/series/luyen-thi/luyen-thi-kcna/chapters/02-container-orchestration/lessons/06-orchestration-patterns.md +147 -0
  31. package/content/series/luyen-thi/luyen-thi-kcna/chapters/03-cloud-native-architecture/lessons/07-cloud-native-architecture.md +143 -0
  32. package/content/series/luyen-thi/luyen-thi-kcna/chapters/04-observability-delivery/lessons/08-observability.md +143 -0
  33. package/content/series/luyen-thi/luyen-thi-kcna/chapters/04-observability-delivery/lessons/09-helm-gitops-cicd.md +162 -0
  34. package/content/series/luyen-thi/luyen-thi-kcna/index.md +1 -1
  35. package/data/quizzes.json +1059 -0
  36. package/package.json +1 -1
@@ -0,0 +1,162 @@
1
+ ---
2
+ id: kcna-d4-l09
3
+ title: 'Bài 9: Helm, GitOps & CI/CD'
4
+ slug: 09-helm-gitops-cicd
5
+ description: >-
6
+ Helm package manager, GitOps với Argo CD, CI/CD pipelines cho Kubernetes.
7
+ Deployment strategies: rolling update, canary, blue-green.
8
+ duration_minutes: 60
9
+ is_free: true
10
+ video_url: null
11
+ sort_order: 9
12
+ section_title: "Domain 4: Cloud Native Observability & Security (16%)"
13
+ course:
14
+ id: lt-kcna-series-001
15
+ title: 'Luyện thi KCNA — Kubernetes and Cloud Native Associate'
16
+ slug: luyen-thi-kcna
17
+ ---
18
+
19
+ <img src="/storage/uploads/2026/04/k8s-cert-kcna-bai9-helm-gitops.png" alt="GitOps Workflow với Helm và Argo CD" style="max-width: 800px; width: 100%; border-radius: 12px;" />
20
+
21
+ <h2 id="helm">1. Helm — Kubernetes Package Manager</h2>
22
+
23
+ <p><strong>Helm</strong> là package manager cho Kubernetes. Charts là template YAML có thể reuse và parameterize.</p>
24
+
25
+ <pre><code class="language-text">Helm Concepts:
26
+ Chart = Package (templates + default values)
27
+ Release = Installed instance of a chart in a cluster
28
+ Repository = Collection of charts (ArtifactHub.io)
29
+ Values = Parameters to customize a chart
30
+
31
+ $ helm install my-nginx bitnami/nginx --set service.type=LoadBalancer
32
+ └── Release: my-nginx
33
+ ├── templates/deployment.yaml
34
+ ├── templates/service.yaml
35
+ └── values.yaml (overridden)</code></pre>
36
+
37
+ <table>
38
+ <thead><tr><th>Helm Command</th><th>Chức năng</th></tr></thead>
39
+ <tbody>
40
+ <tr><td><code>helm install</code></td><td>Deploy chart mới (tạo release)</td></tr>
41
+ <tr><td><code>helm upgrade</code></td><td>Update release với chart mới/values mới</td></tr>
42
+ <tr><td><code>helm rollback</code></td><td>Khôi phục về revision trước</td></tr>
43
+ <tr><td><code>helm list</code></td><td>Liệt kê tất cả releases</td></tr>
44
+ <tr><td><code>helm uninstall</code></td><td>Xóa release</td></tr>
45
+ <tr><td><code>helm template</code></td><td>Render templates mà không deploy</td></tr>
46
+ </tbody>
47
+ </table>
48
+
49
+ <blockquote><p><strong>Exam tip:</strong> Helm lưu release history trong Kubernetes Secrets (không phải ConfigMap). Điều này cho phép <code>helm rollback</code> hoạt động. History mặc định giữ 10 revisions.</p></blockquote>
50
+
51
+ <h2 id="gitops">2. GitOps</h2>
52
+
53
+ <p><strong>GitOps</strong> là operational framework dùng Git làm <strong>single source of truth</strong> cho cả code lẫn infrastructure config.</p>
54
+
55
+ <pre><code class="language-text">GitOps Flow:
56
+ Developer ──push──► Git Repo (desired state)
57
+
58
+ GitOps Operator (Argo CD / Flux)
59
+ - Watches Git repo
60
+ - Compares with cluster state
61
+ - Syncs if diff found
62
+
63
+ K8s Cluster (actual state)</code></pre>
64
+
65
+ <table>
66
+ <thead><tr><th>GitOps Principle</th><th>Ý nghĩa</th></tr></thead>
67
+ <tbody>
68
+ <tr><td><strong>Declarative</strong></td><td>System state mô tả bằng YAML trong Git</td></tr>
69
+ <tr><td><strong>Versioned & immutable</strong></td><td>Git history = audit trail</td></tr>
70
+ <tr><td><strong>Pulled automatically</strong></td><td>Agent pull changes, không cần push access vào cluster</td></tr>
71
+ <tr><td><strong>Continuously reconciled</strong></td><td>Drift detection — auto-correct nếu cluster khác Git</td></tr>
72
+ </tbody>
73
+ </table>
74
+
75
+ <h3 id="argo-cd">Argo CD</h3>
76
+
77
+ <p><strong>Argo CD</strong> là GitOps controller phổ biến nhất cho Kubernetes (CNCF Incubating → Graduated 2022).</p>
78
+
79
+ <blockquote><p><strong>Exam tip:</strong> GitOps dùng <strong>pull-based</strong> deployment thay vì push. Lợi ích: cluster không cần expose API ra bên ngoài, CI pipeline không cần kubeconfig credentials.</p></blockquote>
80
+
81
+ <h2 id="cicd">3. CI/CD cho Kubernetes</h2>
82
+
83
+ <pre><code class="language-text">CI/CD Pipeline:
84
+ Code Push
85
+
86
+ ┌───▼───┐ CI Phase (Build)
87
+ │ Build │── Unit tests ── Integration tests
88
+ │ Image │── Security scan (Trivy, Snyk)
89
+ └───┬───┘── Push to Registry (ECR, GCR)
90
+
91
+ ┌───▼───┐ CD Phase (Deploy)
92
+ │ Update │── Update Helm values / K8s manifest
93
+ │ Manifest│── Push to GitOps repo
94
+ └───┬───┘── Argo CD picks up and syncs
95
+
96
+ ┌───▼────────────────────┐
97
+ │ Kubernetes Cluster │
98
+ │ Rolling Update │
99
+ └────────────────────────┘</code></pre>
100
+
101
+ <h2 id="deployment-strategies">4. Deployment Strategies</h2>
102
+
103
+ <table>
104
+ <thead><tr><th>Strategy</th><th>Cách hoạt động</th><th>Downtime</th><th>Rollback</th><th>Dùng khi</th></tr></thead>
105
+ <tbody>
106
+ <tr><td><strong>Rolling Update</strong></td><td>Replace pods gradually (default)</td><td>Không</td><td>kubectl rollout undo</td><td>Stateless apps, gradual</td></tr>
107
+ <tr><td><strong>Recreate</strong></td><td>Kill all v1, then deploy v2</td><td>Có</td><td>Redeploy v1</td><td>Breaking changes, simple</td></tr>
108
+ <tr><td><strong>Blue-Green</strong></td><td>Run v1 (blue) + v2 (green) side by side, switch traffic</td><td>Không</td><td>Switch back instantly</td><td>Kritisch apps, fast rollback</td></tr>
109
+ <tr><td><strong>Canary</strong></td><td>Route small % traffic to new version</td><td>Không</td><td>Redirect traffic</td><td>Staged rollout, A/B testing</td></tr>
110
+ </tbody>
111
+ </table>
112
+
113
+ <pre><code class="language-text">Canary in Kubernetes (Ingress weight):
114
+ ┌─────────────────────────────────┐
115
+ │ Ingress (canary annotation) │
116
+ │ 90% ──────► Deployment v1.0 │
117
+ │ 10% ──────► Deployment v1.1 │
118
+ └─────────────────────────────────┘
119
+ → Monitor v1.1 errors → promote to 100% or rollback</code></pre>
120
+
121
+ <h2 id="cheatsheet">5. Cheat Sheet</h2>
122
+
123
+ <table>
124
+ <thead><tr><th>Câu hỏi exam</th><th>Đáp án</th></tr></thead>
125
+ <tbody>
126
+ <tr><td>Helm lưu release history ở đâu?</td><td><strong>Kubernetes Secrets</strong></td></tr>
127
+ <tr><td>GitOps single source of truth?</td><td><strong>Git repository</strong></td></tr>
128
+ <tr><td>GitOps dùng pull hay push?</td><td><strong>Pull-based</strong> (agent pulls)</td></tr>
129
+ <tr><td>Deployment không có downtime?</td><td><strong>Rolling</strong> hoặc <strong>Blue-Green</strong></td></tr>
130
+ <tr><td>Test new version với 5% traffic?</td><td><strong>Canary</strong> deployment</td></tr>
131
+ <tr><td>Fast rollback khi có issue?</td><td><strong>Blue-Green</strong> (instant switch)</td></tr>
132
+ </tbody>
133
+ </table>
134
+
135
+ <h2 id="practice">6. Practice Questions</h2>
136
+
137
+ <p><strong>Q1:</strong> A team wants to deploy a new version of their app to 10% of users first, monitor for errors, then gradually increase traffic. Which deployment strategy should they use?</p>
138
+ <ul>
139
+ <li>A) Recreate</li>
140
+ <li>B) Rolling Update</li>
141
+ <li>C) Blue-Green</li>
142
+ <li>D) Canary ✓</li>
143
+ </ul>
144
+ <p><em>Explanation: Canary deployment routes a small percentage of traffic to the new version, allowing teams to validate it with real traffic before full rollout. This minimizes blast radius if the new version has bugs.</em></p>
145
+
146
+ <p><strong>Q2:</strong> Which of the following best describes the GitOps model?</p>
147
+ <ul>
148
+ <li>A) CI/CD pipeline pushes directly to Kubernetes after tests pass</li>
149
+ <li>B) Git repository is the single source of truth; a controller continuously reconciles cluster state with Git ✓</li>
150
+ <li>C) Developers manually apply kubectl commands from their workstations</li>
151
+ <li>D) Infrastructure is defined in a relational database for consistency</li>
152
+ </ul>
153
+ <p><em>Explanation: GitOps uses a pull-based model where a controller (Argo CD, Flux) watches a Git repository and ensures the cluster matches what's declared in Git. This provides audit trail, drift detection, and secure deployments.</em></p>
154
+
155
+ <p><strong>Q3:</strong> Where does Helm store release history to enable rollback capability?</p>
156
+ <ul>
157
+ <li>A) Helm's local filesystem (~/.helm)</li>
158
+ <li>B) ConfigMap in the target namespace</li>
159
+ <li>C) Secret in the target namespace ✓</li>
160
+ <li>D) A separate etcd database</li>
161
+ </ul>
162
+ <p><em>Explanation: Since Helm v3, release metadata (history, values, chart info) is stored as Secrets in the release's namespace. This enables helm rollback by reading previous revision data, and allows multiple users/systems to manage the same release.</em></p>
@@ -8,7 +8,7 @@ description: >-
8
8
  Cloud Native Architecture (16%), Observability (8%), Application Delivery (8%).
9
9
  9 bài học chuyên sâu kèm bài tập trắc nghiệm tiếng Anh.
10
10
 
11
- featured_image: null
11
+ featured_image: images/blog/luyen-thi-kcna-banner.png
12
12
  level: beginner
13
13
  duration_hours: 20
14
14
  lesson_count: 9