@xdev-asia/xdev-knowledge-mcp 1.0.43 → 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.
- package/content/pages/xoa-du-lieu-nguoi-dung.md +68 -0
- package/content/series/luyen-thi/luyen-thi-aws-ml-specialty/chapters/01-phan-1-data-engineering/lessons/01-bai-1-data-repositories-ingestion.md +5 -0
- package/content/series/luyen-thi/luyen-thi-aws-ml-specialty/chapters/01-phan-1-data-engineering/lessons/02-bai-2-data-transformation.md +5 -0
- package/content/series/luyen-thi/luyen-thi-aws-ml-specialty/chapters/01-phan-1-data-engineering/lessons/03-bai-3-data-analysis.md +159 -0
- package/content/series/luyen-thi/luyen-thi-aws-ml-specialty/chapters/02-phan-2-modeling/lessons/04-bai-4-sagemaker-built-in-algorithms.md +186 -0
- package/content/series/luyen-thi/luyen-thi-aws-ml-specialty/chapters/02-phan-2-modeling/lessons/05-bai-5-training-hyperparameter-tuning.md +159 -0
- package/content/series/luyen-thi/luyen-thi-aws-ml-specialty/chapters/02-phan-2-modeling/lessons/06-bai-6-model-evaluation.md +169 -0
- package/content/series/luyen-thi/luyen-thi-aws-ml-specialty/chapters/03-phan-3-implementation-operations/lessons/07-bai-7-model-deployment.md +193 -0
- package/content/series/luyen-thi/luyen-thi-aws-ml-specialty/chapters/03-phan-3-implementation-operations/lessons/08-bai-8-model-monitoring-mlops.md +184 -0
- package/content/series/luyen-thi/luyen-thi-aws-ml-specialty/chapters/03-phan-3-implementation-operations/lessons/09-bai-9-security-cost.md +166 -0
- package/content/series/luyen-thi/luyen-thi-aws-ml-specialty/chapters/04-phan-4-on-tap/lessons/10-bai-10-bai-toan-thuong-gap.md +181 -0
- package/content/series/luyen-thi/luyen-thi-aws-ml-specialty/chapters/04-phan-4-on-tap/lessons/11-bai-11-cheat-sheet.md +110 -0
- package/content/series/luyen-thi/luyen-thi-aws-ml-specialty/chapters/04-phan-4-on-tap/lessons/12-bai-12-chien-luoc-thi.md +113 -0
- package/content/series/luyen-thi/luyen-thi-aws-ml-specialty/index.md +1 -1
- package/content/series/luyen-thi/luyen-thi-cka/chapters/01-cluster-architecture/lessons/01-kien-truc-cka-kubeadm.md +133 -0
- package/content/series/luyen-thi/luyen-thi-cka/chapters/01-cluster-architecture/lessons/02-cluster-upgrade-kubeadm.md +147 -0
- package/content/series/luyen-thi/luyen-thi-cka/chapters/01-cluster-architecture/lessons/03-rbac-cka.md +152 -0
- package/content/series/luyen-thi/luyen-thi-cka/chapters/02-workloads-scheduling/lessons/04-deployments-daemonsets-statefulsets.md +186 -0
- package/content/series/luyen-thi/luyen-thi-cka/chapters/02-workloads-scheduling/lessons/05-scheduling-taints-affinity.md +163 -0
- package/content/series/luyen-thi/luyen-thi-cka/chapters/03-services-networking/lessons/06-services-endpoints-coredns.md +145 -0
- package/content/series/luyen-thi/luyen-thi-cka/chapters/03-services-networking/lessons/07-ingress-networkpolicies-cni.md +172 -0
- package/content/series/luyen-thi/luyen-thi-cka/chapters/04-storage/lessons/08-persistent-volumes-storageclass.md +159 -0
- package/content/series/luyen-thi/luyen-thi-cka/chapters/05-troubleshooting/lessons/09-etcd-backup-restore.md +149 -0
- package/content/series/luyen-thi/luyen-thi-cka/chapters/05-troubleshooting/lessons/10-troubleshooting-nodes.md +153 -0
- package/content/series/luyen-thi/luyen-thi-cka/chapters/05-troubleshooting/lessons/11-troubleshooting-workloads.md +146 -0
- package/content/series/luyen-thi/luyen-thi-cka/chapters/05-troubleshooting/lessons/12-troubleshooting-networking-exam.md +170 -0
- package/content/series/luyen-thi/luyen-thi-cka/index.md +217 -0
- package/content/series/luyen-thi/luyen-thi-ckad/chapters/01-app-design-build/lessons/01-multi-container-pods.md +146 -0
- package/content/series/luyen-thi/luyen-thi-ckad/chapters/01-app-design-build/lessons/02-jobs-cronjobs-resources.md +174 -0
- package/content/series/luyen-thi/luyen-thi-ckad/chapters/02-app-deployment/lessons/03-rolling-updates-rollbacks.md +148 -0
- package/content/series/luyen-thi/luyen-thi-ckad/chapters/02-app-deployment/lessons/04-helm-kustomize.md +181 -0
- package/content/series/luyen-thi/luyen-thi-ckad/chapters/03-app-observability/lessons/05-probes-logging-debugging.md +183 -0
- package/content/series/luyen-thi/luyen-thi-ckad/chapters/04-app-environment-config/lessons/06-configmaps-secrets.md +182 -0
- package/content/series/luyen-thi/luyen-thi-ckad/chapters/04-app-environment-config/lessons/07-securitycontext-pod-security.md +168 -0
- package/content/series/luyen-thi/luyen-thi-ckad/chapters/04-app-environment-config/lessons/08-resources-qos.md +168 -0
- package/content/series/luyen-thi/luyen-thi-ckad/chapters/05-services-networking/lessons/09-services-ingress.md +182 -0
- package/content/series/luyen-thi/luyen-thi-ckad/chapters/05-services-networking/lessons/10-networkpolicies-exam-strategy.md +236 -0
- package/content/series/luyen-thi/luyen-thi-ckad/index.md +199 -0
- package/content/series/luyen-thi/luyen-thi-gcp-ml-engineer/chapters/01-phan-1-problem-framing/lessons/01-bai-1-framing-ml-problems.md +136 -0
- package/content/series/luyen-thi/luyen-thi-gcp-ml-engineer/chapters/01-phan-1-problem-framing/lessons/02-bai-2-gcp-ai-ml-ecosystem.md +160 -0
- package/content/series/luyen-thi/luyen-thi-gcp-ml-engineer/chapters/02-phan-2-data-engineering/lessons/03-bai-3-data-pipeline.md +174 -0
- package/content/series/luyen-thi/luyen-thi-gcp-ml-engineer/chapters/02-phan-2-data-engineering/lessons/04-bai-4-feature-engineering.md +156 -0
- package/content/series/luyen-thi/luyen-thi-gcp-ml-engineer/chapters/03-phan-3-model-development/lessons/05-bai-5-vertex-ai-training.md +155 -0
- package/content/series/luyen-thi/luyen-thi-gcp-ml-engineer/chapters/03-phan-3-model-development/lessons/06-bai-6-bigquery-ml-tensorflow.md +141 -0
- package/content/series/luyen-thi/luyen-thi-gcp-ml-engineer/chapters/04-phan-4-deployment-mlops/lessons/07-bai-7-model-deployment.md +134 -0
- package/content/series/luyen-thi/luyen-thi-gcp-ml-engineer/chapters/04-phan-4-deployment-mlops/lessons/08-bai-8-vertex-ai-pipelines-mlops.md +149 -0
- package/content/series/luyen-thi/luyen-thi-gcp-ml-engineer/chapters/05-phan-5-responsible-ai/lessons/09-bai-9-responsible-ai.md +128 -0
- package/content/series/luyen-thi/luyen-thi-gcp-ml-engineer/chapters/05-phan-5-responsible-ai/lessons/10-bai-10-cheat-sheet-chien-luoc-thi.md +108 -0
- package/content/series/luyen-thi/luyen-thi-gcp-ml-engineer/index.md +1 -1
- package/content/series/luyen-thi/luyen-thi-kcna/chapters/01-kubernetes-fundamentals/lessons/01-kien-truc-kubernetes.md +137 -0
- package/content/series/luyen-thi/luyen-thi-kcna/chapters/01-kubernetes-fundamentals/lessons/02-pods-workloads-controllers.md +142 -0
- package/content/series/luyen-thi/luyen-thi-kcna/chapters/01-kubernetes-fundamentals/lessons/03-services-networking-storage.md +155 -0
- package/content/series/luyen-thi/luyen-thi-kcna/chapters/01-kubernetes-fundamentals/lessons/04-rbac-security.md +137 -0
- package/content/series/luyen-thi/luyen-thi-kcna/chapters/02-container-orchestration/lessons/05-container-runtimes-oci.md +137 -0
- package/content/series/luyen-thi/luyen-thi-kcna/chapters/02-container-orchestration/lessons/06-orchestration-patterns.md +147 -0
- package/content/series/luyen-thi/luyen-thi-kcna/chapters/03-cloud-native-architecture/lessons/07-cloud-native-architecture.md +143 -0
- package/content/series/luyen-thi/luyen-thi-kcna/chapters/04-observability-delivery/lessons/08-observability.md +143 -0
- package/content/series/luyen-thi/luyen-thi-kcna/chapters/04-observability-delivery/lessons/09-helm-gitops-cicd.md +162 -0
- package/content/series/luyen-thi/luyen-thi-kcna/index.md +168 -0
- package/data/quizzes.json +1059 -0
- package/package.json +1 -1
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: 019c9619-lt03-l09
|
|
3
|
+
title: 'Bài 9: Responsible AI & Security'
|
|
4
|
+
slug: bai-9-responsible-ai
|
|
5
|
+
description: >-
|
|
6
|
+
Google Responsible AI principles. Vertex AI Explainability (SHAP, IG).
|
|
7
|
+
Fairness indicators. Privacy: differential privacy, federated learning.
|
|
8
|
+
IAM, VPC-SC, CMEK cho ML workloads.
|
|
9
|
+
duration_minutes: 50
|
|
10
|
+
is_free: true
|
|
11
|
+
video_url: null
|
|
12
|
+
sort_order: 9
|
|
13
|
+
section_title: "Phần 5: Responsible AI & Ôn tập"
|
|
14
|
+
course:
|
|
15
|
+
id: 019c9619-lt03-7003-c003-lt0300000003
|
|
16
|
+
title: 'Luyện thi Google Cloud Professional Machine Learning Engineer'
|
|
17
|
+
slug: luyen-thi-gcp-ml-engineer
|
|
18
|
+
---
|
|
19
|
+
|
|
20
|
+
<h2 id="responsible-ai"><strong>1. Google's Responsible AI Principles</strong></h2>
|
|
21
|
+
|
|
22
|
+
<table>
|
|
23
|
+
<thead><tr><th>Principle</th><th>Key Requirement</th></tr></thead>
|
|
24
|
+
<tbody>
|
|
25
|
+
<tr><td><strong>Socially Beneficial</strong></td><td>Benefits society and individuals</td></tr>
|
|
26
|
+
<tr><td><strong>Avoid Unfair Bias</strong></td><td>Test fairness across demographic groups</td></tr>
|
|
27
|
+
<tr><td><strong>Safety</strong></td><td>Test across diverse scenarios, continuous evaluation</td></tr>
|
|
28
|
+
<tr><td><strong>Accountable</strong></td><td>Appropriate human oversight and control</td></tr>
|
|
29
|
+
<tr><td><strong>Privacy Preserving</strong></td><td>Protect training data privacy</td></tr>
|
|
30
|
+
<tr><td><strong>Scientific Excellence</strong></td><td>Rigorous research standards</td></tr>
|
|
31
|
+
<tr><td><strong>Available for Beneficial Uses</strong></td><td>Primary benefit criteria</td></tr>
|
|
32
|
+
</tbody>
|
|
33
|
+
</table>
|
|
34
|
+
|
|
35
|
+
<h2 id="explainability"><strong>2. Vertex AI Explainability</strong></h2>
|
|
36
|
+
|
|
37
|
+
<p>Vertex AI Explainability cung cấp feature attribution scores — giải thích tại sao model đưa ra prediction nào đó.</p>
|
|
38
|
+
|
|
39
|
+
<table>
|
|
40
|
+
<thead><tr><th>Method</th><th>For</th><th>How</th></tr></thead>
|
|
41
|
+
<tbody>
|
|
42
|
+
<tr><td><strong>SHAP (Shapley Values)</strong></td><td>Tabular models</td><td>Game theory: contribution của mỗi feature</td></tr>
|
|
43
|
+
<tr><td><strong>Integrated Gradients (IG)</strong></td><td>Neural networks (image, text)</td><td>Gradient accumulation from baseline to input</td></tr>
|
|
44
|
+
<tr><td><strong>XRAI</strong></td><td>Image models</td><td>Pixel-region attribution (better UX than IG)</td></tr>
|
|
45
|
+
<tr><td><strong>Sampled Shapley</strong></td><td>Large tabular datasets</td><td>Approximate SHAP, faster</td></tr>
|
|
46
|
+
</tbody>
|
|
47
|
+
</table>
|
|
48
|
+
|
|
49
|
+
<blockquote>
|
|
50
|
+
<p><strong>Exam tip:</strong> "Explain why a loan was denied" → SHAP for tabular models. "Highlight which image regions drove classification" → Integrated Gradients or XRAI. Vertex AI Explainability phải được enable lúc deploy endpoint.</p>
|
|
51
|
+
</blockquote>
|
|
52
|
+
|
|
53
|
+
<h2 id="fairness"><strong>3. Fairness & Bias Detection</strong></h2>
|
|
54
|
+
|
|
55
|
+
<table>
|
|
56
|
+
<thead><tr><th>Tool/Concept</th><th>Description</th></tr></thead>
|
|
57
|
+
<tbody>
|
|
58
|
+
<tr><td><strong>Fairness Indicators</strong></td><td>GCP tool: evaluate model fairness metrics across demographic slices</td></tr>
|
|
59
|
+
<tr><td><strong>What-If Tool</strong></td><td>Interactive exploration of model behavior, counterfactuals</td></tr>
|
|
60
|
+
<tr><td><strong>Demographic parity</strong></td><td>Model predicts same rate across demographic groups</td></tr>
|
|
61
|
+
<tr><td><strong>Equal opportunity</strong></td><td>Same recall/TPR across groups</td></tr>
|
|
62
|
+
<tr><td><strong>Data slice evaluation</strong></td><td>Evaluate metrics per gender, race, age in TFX Evaluator</td></tr>
|
|
63
|
+
</tbody>
|
|
64
|
+
</table>
|
|
65
|
+
|
|
66
|
+
<h2 id="privacy"><strong>4. Privacy Techniques</strong></h2>
|
|
67
|
+
|
|
68
|
+
<table>
|
|
69
|
+
<thead><tr><th>Technique</th><th>Description</th></tr></thead>
|
|
70
|
+
<tbody>
|
|
71
|
+
<tr><td><strong>Differential Privacy</strong></td><td>Add statistical noise to training data/model, prevents individual data re-identification</td></tr>
|
|
72
|
+
<tr><td><strong>Federated Learning</strong></td><td>Train on distributed data without centralizing raw data — model updates only</td></tr>
|
|
73
|
+
<tr><td><strong>Data Anonymization</strong></td><td>Remove PII before training (Cloud DLP API)</td></tr>
|
|
74
|
+
</tbody>
|
|
75
|
+
</table>
|
|
76
|
+
|
|
77
|
+
<h2 id="security"><strong>5. Security Controls for ML Workloads</strong></h2>
|
|
78
|
+
|
|
79
|
+
<table>
|
|
80
|
+
<thead><tr><th>Control</th><th>Purpose</th></tr></thead>
|
|
81
|
+
<tbody>
|
|
82
|
+
<tr><td><strong>IAM roles</strong></td><td>Least-privilege access for ML service accounts</td></tr>
|
|
83
|
+
<tr><td><strong>VPC Service Controls (VPC-SC)</strong></td><td>Security perimeter: prevent data exfiltration from BigQuery, GCS</td></tr>
|
|
84
|
+
<tr><td><strong>CMEK (Customer-Managed Encryption Keys)</strong></td><td>Control encryption keys via Cloud KMS</td></tr>
|
|
85
|
+
<tr><td><strong>Private IP for Vertex AI</strong></td><td>Training and endpoints use private networking</td></tr>
|
|
86
|
+
<tr><td><strong>Cloud Audit Logs</strong></td><td>Who accessed what data, when (Data Access + Admin Activity)</td></tr>
|
|
87
|
+
</tbody>
|
|
88
|
+
</table>
|
|
89
|
+
|
|
90
|
+
<pre><code class="language-text">VPC Service Controls Perimeter:
|
|
91
|
+
|
|
92
|
+
┌────── Security Perimeter ─────────┐
|
|
93
|
+
│ BigQuery │ Cloud Storage │
|
|
94
|
+
│ Vertex AI │ Cloud KMS │
|
|
95
|
+
│ Dataflow │ Secret Manager │
|
|
96
|
+
└──────────────────────────────────┘
|
|
97
|
+
│ (no exfiltration outside perimeter)
|
|
98
|
+
✗ Unauthorized access blocked
|
|
99
|
+
</code></pre>
|
|
100
|
+
|
|
101
|
+
<h2 id="practice"><strong>6. Practice Questions</strong></h2>
|
|
102
|
+
|
|
103
|
+
<p><strong>Q1:</strong> A financial services company deployed a loan approval ML model. Regulators require the company to explain why specific loan applications were denied. Which Vertex AI feature provides per-prediction feature importance scores for tabular models?</p>
|
|
104
|
+
<ul>
|
|
105
|
+
<li>A) Vertex AI Experiments</li>
|
|
106
|
+
<li>B) Vertex AI Explainability with SHAP ✓</li>
|
|
107
|
+
<li>C) Vertex AI Model Monitoring</li>
|
|
108
|
+
<li>D) Fairness Indicators</li>
|
|
109
|
+
</ul>
|
|
110
|
+
<p><em>Explanation: Vertex AI Explainability with Shapley Values (SHAP) assigns an importance score to each feature for each individual prediction, explaining why a specific loan was denied by attributing the model's decision to specific input features like credit_score, income, debt_ratio.</em></p>
|
|
111
|
+
|
|
112
|
+
<p><strong>Q2:</strong> A healthcare company needs to train ML models on patient data distributed across multiple hospitals. Data privacy regulations prohibit centralizing raw patient records. Which privacy-preserving ML approach should they use?</p>
|
|
113
|
+
<ul>
|
|
114
|
+
<li>A) Differential Privacy with central training</li>
|
|
115
|
+
<li>B) Federated Learning ✓</li>
|
|
116
|
+
<li>C) Data anonymization + BigQuery ML</li>
|
|
117
|
+
<li>D) Cloud DLP de-identification</li>
|
|
118
|
+
</ul>
|
|
119
|
+
<p><em>Explanation: Federated Learning trains models on distributed data without moving raw data to a central location. Each hospital trains locally on its own data; only model updates (gradients) are shared and aggregated. Raw patient records never leave the hospital's environment.</em></p>
|
|
120
|
+
|
|
121
|
+
<p><strong>Q3:</strong> A company processes sensitive financial data in BigQuery for ML training. They need to prevent data from being moved outside an approved security boundary to unauthorized GCP projects. Which GCP feature should they implement?</p>
|
|
122
|
+
<ul>
|
|
123
|
+
<li>A) Cloud KMS CMEK encryption</li>
|
|
124
|
+
<li>B) VPC Service Controls (VPC-SC) perimeter ✓</li>
|
|
125
|
+
<li>C) IAM role deny policies</li>
|
|
126
|
+
<li>D) Cloud Armor WAF</li>
|
|
127
|
+
</ul>
|
|
128
|
+
<p><em>Explanation: VPC Service Controls creates a security perimeter around GCP services (BigQuery, Cloud Storage, Vertex AI). It prevents data exfiltration by blocking requests that would move data outside the defined perimeter, even from authenticated users. CMEK provides encryption control but doesn't prevent exfiltration.</em></p>
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: 019c9619-lt03-l10
|
|
3
|
+
title: 'Bài 10: Cheat Sheet & Chiến lược thi GCP MLE'
|
|
4
|
+
slug: bai-10-cheat-sheet-chien-luoc-thi
|
|
5
|
+
description: >-
|
|
6
|
+
Bảng tổng hợp toàn khoá GCP Professional Machine Learning Engineer.
|
|
7
|
+
GCP service reference, evaluation metrics, domain weights, và chiến lược thi.
|
|
8
|
+
duration_minutes: 40
|
|
9
|
+
is_free: true
|
|
10
|
+
video_url: null
|
|
11
|
+
sort_order: 10
|
|
12
|
+
section_title: "Phần 5: Responsible AI & Ôn tập"
|
|
13
|
+
course:
|
|
14
|
+
id: 019c9619-lt03-7003-c003-lt0300000003
|
|
15
|
+
title: 'Luyện thi Google Cloud Professional Machine Learning Engineer'
|
|
16
|
+
slug: luyen-thi-gcp-ml-engineer
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
<h2 id="exam-structure"><strong>1. Cấu Trúc Đề Thi GCP Professional ML Engineer</strong></h2>
|
|
20
|
+
|
|
21
|
+
<table>
|
|
22
|
+
<thead><tr><th>Item</th><th>Details</th></tr></thead>
|
|
23
|
+
<tbody>
|
|
24
|
+
<tr><td><strong>Total Questions</strong></td><td>60 câu</td></tr>
|
|
25
|
+
<tr><td><strong>Time Limit</strong></td><td>120 phút (2 giờ)</td></tr>
|
|
26
|
+
<tr><td><strong>Passing Score</strong></td><td>~70% (Google không công bố chính xác)</td></tr>
|
|
27
|
+
<tr><td><strong>Format</strong></td><td>Multiple choice, multiple select</td></tr>
|
|
28
|
+
<tr><td><strong>Validity</strong></td><td>2 năm</td></tr>
|
|
29
|
+
<tr><td><strong>Level</strong></td><td>Professional (intermediate to advanced)</td></tr>
|
|
30
|
+
</tbody>
|
|
31
|
+
</table>
|
|
32
|
+
|
|
33
|
+
<h2 id="domain-weights"><strong>2. Domain Weights</strong></h2>
|
|
34
|
+
|
|
35
|
+
<table>
|
|
36
|
+
<thead><tr><th>Domain</th><th>Weight</th></tr></thead>
|
|
37
|
+
<tbody>
|
|
38
|
+
<tr><td>1. Architecting low-code ML solutions</td><td>~10%</td></tr>
|
|
39
|
+
<tr><td>2. Collaborate within and across teams to manage data and models</td><td>~20%</td></tr>
|
|
40
|
+
<tr><td>3. Scale prototypes into ML models</td><td>~20%</td></tr>
|
|
41
|
+
<tr><td>4. Serve and scale models</td><td>~20%</td></tr>
|
|
42
|
+
<tr><td>5. Automate & orchestrate ML pipelines</td><td>~20%</td></tr>
|
|
43
|
+
<tr><td>6. Monitor ML solutions</td><td>~10%</td></tr>
|
|
44
|
+
</tbody>
|
|
45
|
+
</table>
|
|
46
|
+
|
|
47
|
+
<h2 id="service-cheat-sheet"><strong>3. GCP ML Services Cheat Sheet</strong></h2>
|
|
48
|
+
|
|
49
|
+
<table>
|
|
50
|
+
<thead><tr><th>Task</th><th>GCP Service</th></tr></thead>
|
|
51
|
+
<tbody>
|
|
52
|
+
<tr><td>No-code image classification</td><td>Vertex AI AutoML Image</td></tr>
|
|
53
|
+
<tr><td>SQL-based ML in data warehouse</td><td>BigQuery ML</td></tr>
|
|
54
|
+
<tr><td>Custom TensorFlow/PyTorch training</td><td>Vertex AI Custom Training</td></tr>
|
|
55
|
+
<tr><td>Hyperparameter optimization</td><td>Vertex AI Hyperparameter Tuning (Bayesian)</td></tr>
|
|
56
|
+
<tr><td>Feature consistency training/serving</td><td>Vertex AI Feature Store</td></tr>
|
|
57
|
+
<tr><td>ML workflow orchestration (pipelines)</td><td>Vertex AI Pipelines (KFP)</td></tr>
|
|
58
|
+
<tr><td>Experiment tracking</td><td>Vertex AI Experiments</td></tr>
|
|
59
|
+
<tr><td>Model versioning</td><td>Vertex AI Model Registry</td></tr>
|
|
60
|
+
<tr><td>A/B testing model versions</td><td>Vertex AI Endpoints traffic splitting</td></tr>
|
|
61
|
+
<tr><td>Monitor feature skew/drift</td><td>Vertex AI Model Monitoring</td></tr>
|
|
62
|
+
<tr><td>Explain model predictions</td><td>Vertex AI Explainability (SHAP, IG)</td></tr>
|
|
63
|
+
<tr><td>Real-time event ingestion</td><td>Pub/Sub</td></tr>
|
|
64
|
+
<tr><td>Batch + streaming ETL (unified)</td><td>Dataflow (Apache Beam)</td></tr>
|
|
65
|
+
<tr><td>Spark/Hadoop workloads</td><td>Dataproc</td></tr>
|
|
66
|
+
<tr><td>ML pipeline orchestration (multi-service)</td><td>Cloud Composer (Airflow)</td></tr>
|
|
67
|
+
<tr><td>Natural language analysis (no training)</td><td>Cloud Natural Language API</td></tr>
|
|
68
|
+
<tr><td>Document extraction</td><td>Document AI</td></tr>
|
|
69
|
+
<tr><td>Speech to text</td><td>Cloud Speech-to-Text API</td></tr>
|
|
70
|
+
<tr><td>Prevent data exfiltration</td><td>VPC Service Controls</td></tr>
|
|
71
|
+
<tr><td>Customer-managed encryption</td><td>Cloud KMS (CMEK)</td></tr>
|
|
72
|
+
</tbody>
|
|
73
|
+
</table>
|
|
74
|
+
|
|
75
|
+
<h2 id="traps"><strong>4. Common Exam Traps</strong></h2>
|
|
76
|
+
|
|
77
|
+
<table>
|
|
78
|
+
<thead><tr><th>Trap</th><th>Correct Answer</th></tr></thead>
|
|
79
|
+
<tbody>
|
|
80
|
+
<tr><td>"No ML expertise, image classification"</td><td>AutoML Image (not custom training)</td></tr>
|
|
81
|
+
<tr><td>"Train on data already in BigQuery"</td><td>BigQuery ML (not Vertex AI)</td></tr>
|
|
82
|
+
<tr><td>"Features differ at training vs serving"</td><td>Vertex AI Feature Store (not re-training)</td></tr>
|
|
83
|
+
<tr><td>"Trigger retraining when data arrives"</td><td>GCS notification → Eventarc → Vertex AI Pipeline</td></tr>
|
|
84
|
+
<tr><td>"Explain why model rejected application"</td><td>Vertex AI Explainability (SHAP)</td></tr>
|
|
85
|
+
<tr><td>"Train on distributed hospital data"</td><td>Federated Learning</td></tr>
|
|
86
|
+
<tr><td>"Prevent BigQuery data exfiltration"</td><td>VPC Service Controls</td></tr>
|
|
87
|
+
<tr><td>"Compare model performance across runs"</td><td>Vertex AI Experiments</td></tr>
|
|
88
|
+
</tbody>
|
|
89
|
+
</table>
|
|
90
|
+
|
|
91
|
+
<blockquote>
|
|
92
|
+
<p><strong>Exam tip:</strong> GCP Professional ML Engineer thường hỏi về architecture decisions, không phải API syntax. Key question patterns: "which service BEST fits the requirement", "what is the FIRST step", "which approach requires the LEAST operational overhead". Luôn ưu tiên managed services của GCP khi câu hỏi có "minimal management" hoặc "serverless".</p>
|
|
93
|
+
</blockquote>
|
|
94
|
+
|
|
95
|
+
<h2 id="study-plan"><strong>5. Kế Hoạch Ôn Tập</strong></h2>
|
|
96
|
+
|
|
97
|
+
<table>
|
|
98
|
+
<thead><tr><th>Ngày</th><th>Focus</th></tr></thead>
|
|
99
|
+
<tbody>
|
|
100
|
+
<tr><td>Day 1</td><td>Vertex AI full platform: Training, Pipelines, Endpoints, Monitoring</td></tr>
|
|
101
|
+
<tr><td>Day 2</td><td>Data engineering: Pub/Sub, Dataflow, Dataproc, Cloud Composer</td></tr>
|
|
102
|
+
<tr><td>Day 3</td><td>BigQuery ML + Feature Engineering + Feature Store</td></tr>
|
|
103
|
+
<tr><td>Day 4</td><td>Responsible AI: Explainability, Fairness, Privacy, Security</td></tr>
|
|
104
|
+
<tr><td>Day 5</td><td>Practice exam 1 — identify weak areas</td></tr>
|
|
105
|
+
<tr><td>Day 6</td><td>Review weak areas + Practice exam 2</td></tr>
|
|
106
|
+
<tr><td>Day 7</td><td>Cheat sheet review only</td></tr>
|
|
107
|
+
</tbody>
|
|
108
|
+
</table>
|
|
@@ -6,7 +6,7 @@ description: >-
|
|
|
6
6
|
Lộ trình ôn tập toàn diện cho kỳ thi Google Cloud Professional Machine Learning
|
|
7
7
|
Engineer. Vertex AI, BigQuery ML, TFX pipeline, MLOps trên GCP.
|
|
8
8
|
|
|
9
|
-
featured_image:
|
|
9
|
+
featured_image: images/blog/gcp-ml-engineer-series-banner.png
|
|
10
10
|
level: advanced
|
|
11
11
|
duration_hours: 35
|
|
12
12
|
lesson_count: 10
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: kcna-d1-l01
|
|
3
|
+
title: 'Bài 1: Kubernetes Architecture & Core Components'
|
|
4
|
+
slug: 01-kien-truc-kubernetes
|
|
5
|
+
description: >-
|
|
6
|
+
Control plane vs Worker node. kube-apiserver, etcd, kube-scheduler,
|
|
7
|
+
controller-manager, kubelet, kube-proxy. Kubernetes objects overview.
|
|
8
|
+
duration_minutes: 55
|
|
9
|
+
is_free: true
|
|
10
|
+
video_url: null
|
|
11
|
+
sort_order: 1
|
|
12
|
+
section_title: "Domain 1: Kubernetes Fundamentals (46%)"
|
|
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-bai1-architecture.png" alt="Kubernetes Architecture — Control Plane và Worker Node components" style="max-width: 800px; width: 100%; border-radius: 12px;" />
|
|
20
|
+
|
|
21
|
+
<h2 id="overview">1. Tổng quan Kubernetes</h2>
|
|
22
|
+
|
|
23
|
+
<p><strong>Kubernetes</strong> (K8s) là nền tảng orchestration container mã nguồn mở do Google phát triển, tặng cho CNCF năm 2014. Kubernetes tự động hóa việc triển khai, scaling và quản lý containerized applications.</p>
|
|
24
|
+
|
|
25
|
+
<blockquote><p><strong>Exam tip:</strong> KCNA Domain 1 chiếm <strong>46%</strong> đề thi. Câu hỏi thường hỏi "Which component is responsible for..." — học thuộc vai trò từng component.</p></blockquote>
|
|
26
|
+
|
|
27
|
+
<h2 id="architecture">2. Kiến trúc Kubernetes</h2>
|
|
28
|
+
|
|
29
|
+
<p>Cluster Kubernetes gồm hai loại node: <strong>Control Plane</strong> và <strong>Worker Node</strong>.</p>
|
|
30
|
+
|
|
31
|
+
<pre><code class="language-text">┌─────────────────────────────────────────────────────────┐
|
|
32
|
+
│ CONTROL PLANE │
|
|
33
|
+
│ ┌──────────────┐ ┌─────────┐ ┌────────────────────┐ │
|
|
34
|
+
│ │ kube-apiserver│ │ etcd │ │kube-controller-mgr │ │
|
|
35
|
+
│ │ (REST API) │ │(DB key- │ │ - Node Controller │ │
|
|
36
|
+
│ │ front door │ │ value) │ │ - ReplicaSet Ctrl │ │
|
|
37
|
+
│ └──────────────┘ └─────────┘ │ - Endpoints Ctrl │ │
|
|
38
|
+
│ ┌──────────────┐ └────────────────────┘ │
|
|
39
|
+
│ │kube-scheduler│ │
|
|
40
|
+
│ │ (assign node)│ │
|
|
41
|
+
│ └──────────────┘ │
|
|
42
|
+
└─────────────────────────────────────────────────────────┘
|
|
43
|
+
│ │ │
|
|
44
|
+
┌────────▼──────┐ ┌─────▼──────┐ ┌───▼────────────┐
|
|
45
|
+
│ WORKER NODE 1│ │WORKER NODE 2│ │ WORKER NODE 3 │
|
|
46
|
+
│ ┌──────────┐ │ │ ┌────────┐ │ │ ┌──────────┐ │
|
|
47
|
+
│ │ kubelet │ │ │ │kubelet │ │ │ │ kubelet │ │
|
|
48
|
+
│ │kube-proxy│ │ │ │k-proxy │ │ │ │kube-proxy│ │
|
|
49
|
+
│ │ Pod Pod │ │ │ │Pod Pod │ │ │ │ Pod Pod │ │
|
|
50
|
+
│ └──────────┘ │ │ └────────┘ │ │ └──────────┘ │
|
|
51
|
+
└───────────────┘ └────────────┘ └────────────────┘</code></pre>
|
|
52
|
+
|
|
53
|
+
<h2 id="control-plane">3. Control Plane Components</h2>
|
|
54
|
+
|
|
55
|
+
<table>
|
|
56
|
+
<thead><tr><th>Component</th><th>Vai trò</th><th>Từ khóa exam</th></tr></thead>
|
|
57
|
+
<tbody>
|
|
58
|
+
<tr><td><strong>kube-apiserver</strong></td><td>Cổng vào duy nhất của cluster, xử lý REST API. Mọi communication đều qua đây.</td><td>"single point of truth", "REST API", "authentication & authorization"</td></tr>
|
|
59
|
+
<tr><td><strong>etcd</strong></td><td>Key-value store lưu trữ toàn bộ cluster state. Là database của Kubernetes.</td><td>"cluster state", "consistent", "distributed key-value"</td></tr>
|
|
60
|
+
<tr><td><strong>kube-scheduler</strong></td><td>Xem xét Pod chưa có node và chọn node phù hợp dựa trên resources, constraints.</td><td>"schedule", "assign node", "resource fit"</td></tr>
|
|
61
|
+
<tr><td><strong>kube-controller-manager</strong></td><td>Chạy nhiều controller loops: Node, ReplicaSet, Endpoints, ServiceAccount, v.v.</td><td>"reconciliation loop", "desired state", "controller"</td></tr>
|
|
62
|
+
<tr><td><strong>cloud-controller-manager</strong></td><td>Tích hợp với cloud provider API (AWS, GCP, Azure) — tùy chọn.</td><td>"cloud integration", "LoadBalancer provisioning"</td></tr>
|
|
63
|
+
</tbody>
|
|
64
|
+
</table>
|
|
65
|
+
|
|
66
|
+
<h2 id="worker-node">4. Worker Node Components</h2>
|
|
67
|
+
|
|
68
|
+
<table>
|
|
69
|
+
<thead><tr><th>Component</th><th>Vai trò</th><th>Từ khóa exam</th></tr></thead>
|
|
70
|
+
<tbody>
|
|
71
|
+
<tr><td><strong>kubelet</strong></td><td>Agent chạy trên mỗi node, nhận PodSpec từ apiserver và đảm bảo containers chạy đúng.</td><td>"node agent", "PodSpec", "container health"</td></tr>
|
|
72
|
+
<tr><td><strong>kube-proxy</strong></td><td>Quản lý network rules (iptables/IPVS) cho Services. Cho phép network communication đến Pods.</td><td>"networking", "iptables", "Service load balancing"</td></tr>
|
|
73
|
+
<tr><td><strong>Container Runtime</strong></td><td>Software chạy containers: containerd, CRI-O. Docker đã bị deprecated.</td><td>"CRI", "containerd", "run containers"</td></tr>
|
|
74
|
+
</tbody>
|
|
75
|
+
</table>
|
|
76
|
+
|
|
77
|
+
<blockquote><p><strong>Exam tip:</strong> <strong>kubelet</strong> là component duy nhất không chạy trong container — nó là systemd service trực tiếp trên node. Nếu kubelet crash, node sẽ NotReady.</p></blockquote>
|
|
78
|
+
|
|
79
|
+
<h2 id="objects">5. Kubernetes Objects Cơ Bản</h2>
|
|
80
|
+
|
|
81
|
+
<p>Mọi thứ trong Kubernetes là <strong>object</strong> — declarative resources được lưu trong etcd.</p>
|
|
82
|
+
|
|
83
|
+
<table>
|
|
84
|
+
<thead><tr><th>Object</th><th>Mô tả</th><th>Scope</th></tr></thead>
|
|
85
|
+
<tbody>
|
|
86
|
+
<tr><td><strong>Pod</strong></td><td>Unit nhỏ nhất, chứa 1+ containers chia sẻ network và storage</td><td>Namespaced</td></tr>
|
|
87
|
+
<tr><td><strong>Namespace</strong></td><td>Virtual cluster, isolate resources</td><td>Cluster-wide</td></tr>
|
|
88
|
+
<tr><td><strong>Node</strong></td><td>Worker machine (VM hoặc physical)</td><td>Cluster-wide</td></tr>
|
|
89
|
+
<tr><td><strong>Deployment</strong></td><td>Manage stateless app replicas với rolling update</td><td>Namespaced</td></tr>
|
|
90
|
+
<tr><td><strong>Service</strong></td><td>Stable network endpoint cho Pods</td><td>Namespaced</td></tr>
|
|
91
|
+
<tr><td><strong>ConfigMap / Secret</strong></td><td>Configuration data</td><td>Namespaced</td></tr>
|
|
92
|
+
<tr><td><strong>PersistentVolume</strong></td><td>Storage resource</td><td>Cluster-wide</td></tr>
|
|
93
|
+
</tbody>
|
|
94
|
+
</table>
|
|
95
|
+
|
|
96
|
+
<h2 id="cheatsheet">6. Cheat Sheet — Component → Nhiệm vụ</h2>
|
|
97
|
+
|
|
98
|
+
<table>
|
|
99
|
+
<thead><tr><th>Câu hỏi</th><th>Trả lời</th></tr></thead>
|
|
100
|
+
<tbody>
|
|
101
|
+
<tr><td>Lưu cluster state ở đâu?</td><td><strong>etcd</strong></td></tr>
|
|
102
|
+
<tr><td>Component nào chọn node cho Pod?</td><td><strong>kube-scheduler</strong></td></tr>
|
|
103
|
+
<tr><td>Component nào chạy trên mỗi worker, quản lý Pods?</td><td><strong>kubelet</strong></td></tr>
|
|
104
|
+
<tr><td>Component nào xử lý tất cả API calls?</td><td><strong>kube-apiserver</strong></td></tr>
|
|
105
|
+
<tr><td>Component nào manage network rules cho Services?</td><td><strong>kube-proxy</strong></td></tr>
|
|
106
|
+
<tr><td>Component nào watch và reconcile desired state?</td><td><strong>kube-controller-manager</strong></td></tr>
|
|
107
|
+
</tbody>
|
|
108
|
+
</table>
|
|
109
|
+
|
|
110
|
+
<h2 id="practice">7. Practice Questions</h2>
|
|
111
|
+
|
|
112
|
+
<p><strong>Q1:</strong> Which Kubernetes control plane component is responsible for watching newly created Pods that have no node assigned, and selecting a node for them?</p>
|
|
113
|
+
<ul>
|
|
114
|
+
<li>A) kube-apiserver</li>
|
|
115
|
+
<li>B) kube-scheduler ✓</li>
|
|
116
|
+
<li>C) kube-controller-manager</li>
|
|
117
|
+
<li>D) kubelet</li>
|
|
118
|
+
</ul>
|
|
119
|
+
<p><em>Explanation: kube-scheduler watches for unscheduled Pods and assigns them to suitable nodes based on resource requirements, affinity rules, and constraints.</em></p>
|
|
120
|
+
|
|
121
|
+
<p><strong>Q2:</strong> Where does Kubernetes store all cluster configuration and state?</p>
|
|
122
|
+
<ul>
|
|
123
|
+
<li>A) kube-apiserver memory</li>
|
|
124
|
+
<li>B) /etc/kubernetes/ on each node</li>
|
|
125
|
+
<li>C) etcd ✓</li>
|
|
126
|
+
<li>D) kubelet database</li>
|
|
127
|
+
</ul>
|
|
128
|
+
<p><em>Explanation: etcd is the consistent, highly-available key-value store that serves as the backing store for all Kubernetes cluster data. Backing up etcd = backing up the entire cluster.</em></p>
|
|
129
|
+
|
|
130
|
+
<p><strong>Q3:</strong> Which component on a Worker Node is responsible for ensuring containers described in PodSpecs are running and healthy?</p>
|
|
131
|
+
<ul>
|
|
132
|
+
<li>A) kube-proxy</li>
|
|
133
|
+
<li>B) Container runtime</li>
|
|
134
|
+
<li>C) kubelet ✓</li>
|
|
135
|
+
<li>D) kube-controller-manager</li>
|
|
136
|
+
</ul>
|
|
137
|
+
<p><em>Explanation: kubelet is the node agent that receives PodSpecs from kube-apiserver and ensures the described containers are running. It reports node/Pod status back to the control plane.</em></p>
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: kcna-d1-l02
|
|
3
|
+
title: 'Bài 2: Pods, Workloads & Controllers'
|
|
4
|
+
slug: 02-pods-workloads-controllers
|
|
5
|
+
description: >-
|
|
6
|
+
Pod lifecycle. Deployments, ReplicaSets, StatefulSets, DaemonSets,
|
|
7
|
+
Jobs, CronJobs. Labels, selectors, annotations.
|
|
8
|
+
duration_minutes: 55
|
|
9
|
+
is_free: true
|
|
10
|
+
video_url: null
|
|
11
|
+
sort_order: 2
|
|
12
|
+
section_title: "Domain 1: Kubernetes Fundamentals (46%)"
|
|
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-bai2-pods-workloads.png" alt="Kubernetes Workload Controllers — Deployment, StatefulSet, DaemonSet, Job" style="max-width: 800px; width: 100%; border-radius: 12px;" />
|
|
20
|
+
|
|
21
|
+
<h2 id="pod">1. Pod — Đơn vị nhỏ nhất</h2>
|
|
22
|
+
|
|
23
|
+
<p>Một <strong>Pod</strong> là nhóm 1 hoặc nhiều containers chia sẻ cùng network namespace (cùng IP, port space) và storage volumes. Pod là đơn vị scheduling trong Kubernetes.</p>
|
|
24
|
+
|
|
25
|
+
<pre><code class="language-text">┌─────────────────────────────────────┐
|
|
26
|
+
│ POD │
|
|
27
|
+
│ IP: 10.244.1.5 │
|
|
28
|
+
│ ┌────────────┐ ┌───────────────┐ │
|
|
29
|
+
│ │ Container │ │ Sidecar │ │
|
|
30
|
+
│ │ (app) │ │ (log-agent) │ │
|
|
31
|
+
│ └────────────┘ └───────────────┘ │
|
|
32
|
+
│ Shared Volume: /var/log │
|
|
33
|
+
└─────────────────────────────────────┘</code></pre>
|
|
34
|
+
|
|
35
|
+
<h3 id="pod-lifecycle">Pod Lifecycle</h3>
|
|
36
|
+
|
|
37
|
+
<table>
|
|
38
|
+
<thead><tr><th>Phase</th><th>Ý nghĩa</th><th>Debug hint</th></tr></thead>
|
|
39
|
+
<tbody>
|
|
40
|
+
<tr><td><strong>Pending</strong></td><td>Chưa được schedule hoặc đang pull image</td><td>Check events: kubectl describe pod</td></tr>
|
|
41
|
+
<tr><td><strong>Running</strong></td><td>Đang chạy, ít nhất 1 container đang active</td><td>Normal state</td></tr>
|
|
42
|
+
<tr><td><strong>Succeeded</strong></td><td>Tất cả containers thoát với code 0</td><td>Job completed</td></tr>
|
|
43
|
+
<tr><td><strong>Failed</strong></td><td>Ít nhất 1 container thoát với lỗi</td><td>kubectl logs --previous</td></tr>
|
|
44
|
+
<tr><td><strong>Unknown</strong></td><td>Không liên lạc được với node</td><td>Node network issue</td></tr>
|
|
45
|
+
<tr><td><strong>CrashLoopBackOff</strong></td><td>Container liên tục crash và restart</td><td>kubectl logs -p</td></tr>
|
|
46
|
+
</tbody>
|
|
47
|
+
</table>
|
|
48
|
+
|
|
49
|
+
<blockquote><p><strong>Exam tip:</strong> <strong>CrashLoopBackOff</strong> không phải Pod phase chính thức — nó là Container state trong Waiting. Câu hỏi hay hỏi "pod phase" vs "container state".</p></blockquote>
|
|
50
|
+
|
|
51
|
+
<h2 id="workloads">2. Workload Controllers</h2>
|
|
52
|
+
|
|
53
|
+
<table>
|
|
54
|
+
<thead><tr><th>Controller</th><th>Dùng khi</th><th>Đặc điểm nổi bật</th></tr></thead>
|
|
55
|
+
<tbody>
|
|
56
|
+
<tr><td><strong>Deployment</strong></td><td>Stateless apps (web server, API)</td><td>Rolling update, rollback, ReplicaSet management</td></tr>
|
|
57
|
+
<tr><td><strong>ReplicaSet</strong></td><td>Đảm bảo N replicas (thường dùng qua Deployment)</td><td>Label selector, ít dùng trực tiếp</td></tr>
|
|
58
|
+
<tr><td><strong>StatefulSet</strong></td><td>Stateful apps (database, Kafka, Elasticsearch)</td><td>Stable pod names (web-0, web-1), stable storage, ordered deployment</td></tr>
|
|
59
|
+
<tr><td><strong>DaemonSet</strong></td><td>Agent chạy trên mọi node (logging, monitoring, network)</td><td>1 Pod/node, auto-deploy khi node mới join</td></tr>
|
|
60
|
+
<tr><td><strong>Job</strong></td><td>Batch task chạy đến khi hoàn thành</td><td>completions, parallelism, backoffLimit</td></tr>
|
|
61
|
+
<tr><td><strong>CronJob</strong></td><td>Periodic batch tasks</td><td>cron syntax, concurrencyPolicy, schedule</td></tr>
|
|
62
|
+
</tbody>
|
|
63
|
+
</table>
|
|
64
|
+
|
|
65
|
+
<h3 id="deployment-vs-statefulset">Deployment vs StatefulSet</h3>
|
|
66
|
+
|
|
67
|
+
<pre><code class="language-text">DEPLOYMENT (Stateless) STATEFULSET (Stateful)
|
|
68
|
+
───────────────────── ────────────────────────
|
|
69
|
+
Pod names: web-a1b2c3 Pod names: web-0, web-1, web-2
|
|
70
|
+
Any order scale up/down Ordered: web-0 first, then web-1...
|
|
71
|
+
Shared or no storage Each Pod gets its own PVC
|
|
72
|
+
Pod replaced = new identity Pod replaced = same identity
|
|
73
|
+
Examples: nginx, api-server Examples: MySQL, MongoDB, Kafka</code></pre>
|
|
74
|
+
|
|
75
|
+
<h2 id="labels">3. Labels, Selectors & Annotations</h2>
|
|
76
|
+
|
|
77
|
+
<table>
|
|
78
|
+
<thead><tr><th>Concept</th><th>Dùng để</th><th>Ví dụ</th></tr></thead>
|
|
79
|
+
<tbody>
|
|
80
|
+
<tr><td><strong>Labels</strong></td><td>Tag resources để select và group</td><td><code>app: frontend, env: prod</code></td></tr>
|
|
81
|
+
<tr><td><strong>Selectors</strong></td><td>Query resources theo labels</td><td><code>selector: {app: frontend}</code></td></tr>
|
|
82
|
+
<tr><td><strong>Annotations</strong></td><td>Metadata không dùng để select (build info, contact)</td><td><code>maintainer: team@company.com</code></td></tr>
|
|
83
|
+
</tbody>
|
|
84
|
+
</table>
|
|
85
|
+
|
|
86
|
+
<blockquote><p><strong>Exam tip:</strong> Service tìm Pods qua <strong>selector</strong> matching Pod <strong>labels</strong>. Nếu selector không match, Service sẽ có empty Endpoints → traffic không đến được Pod.</p></blockquote>
|
|
87
|
+
|
|
88
|
+
<h2 id="daemonset-usecase">4. DaemonSet Use Cases</h2>
|
|
89
|
+
|
|
90
|
+
<pre><code class="language-text">NODE 1 NODE 2 NODE 3
|
|
91
|
+
┌──────┐ ┌──────┐ ┌──────┐
|
|
92
|
+
│fluentd│ │fluentd│ │fluentd│ ← Log collector DaemonSet
|
|
93
|
+
│ Pod │ │ Pod │ │ Pod │
|
|
94
|
+
├──────┤ ├──────┤ ├──────┤
|
|
95
|
+
│calico│ │calico│ │calico│ ← CNI network plugin DaemonSet
|
|
96
|
+
│ Pod │ │ Pod │ │ Pod │
|
|
97
|
+
└──────┘ └──────┘ └──────┘</code></pre>
|
|
98
|
+
|
|
99
|
+
<p>DaemonSets thường dùng cho: <strong>Fluentd/Filebeat</strong> (log collection), <strong>Prometheus Node Exporter</strong> (metrics), <strong>kube-proxy</strong> (networking), <strong>CNI plugins</strong> (Calico, Cilium).</p>
|
|
100
|
+
|
|
101
|
+
<h2 id="cheatsheet">5. Cheat Sheet</h2>
|
|
102
|
+
|
|
103
|
+
<table>
|
|
104
|
+
<thead><tr><th>Câu hỏi exam</th><th>Đáp án</th></tr></thead>
|
|
105
|
+
<tbody>
|
|
106
|
+
<tr><td>Stateful app, cần stable identity?</td><td><strong>StatefulSet</strong></td></tr>
|
|
107
|
+
<tr><td>1 Pod per node (monitoring agent)?</td><td><strong>DaemonSet</strong></td></tr>
|
|
108
|
+
<tr><td>Stateless app với rolling update?</td><td><strong>Deployment</strong></td></tr>
|
|
109
|
+
<tr><td>One-time batch processing?</td><td><strong>Job</strong></td></tr>
|
|
110
|
+
<tr><td>Scheduled batch (nightly backup)?</td><td><strong>CronJob</strong></td></tr>
|
|
111
|
+
<tr><td>Pod naming pattern cho StatefulSet?</td><td><code>name-0, name-1, name-2</code></td></tr>
|
|
112
|
+
</tbody>
|
|
113
|
+
</table>
|
|
114
|
+
|
|
115
|
+
<h2 id="practice">6. Practice Questions</h2>
|
|
116
|
+
|
|
117
|
+
<p><strong>Q1:</strong> A company needs to deploy a MySQL database on Kubernetes with stable network identity and dedicated storage per replica. Which workload type should they use?</p>
|
|
118
|
+
<ul>
|
|
119
|
+
<li>A) Deployment with PersistentVolumeClaim</li>
|
|
120
|
+
<li>B) StatefulSet ✓</li>
|
|
121
|
+
<li>C) DaemonSet</li>
|
|
122
|
+
<li>D) ReplicaSet</li>
|
|
123
|
+
</ul>
|
|
124
|
+
<p><em>Explanation: StatefulSet provides stable Pod names (mysql-0, mysql-1), ordered deployment/scaling, and each Pod gets its own PVC via volumeClaimTemplates. These properties are essential for databases.</em></p>
|
|
125
|
+
|
|
126
|
+
<p><strong>Q2:</strong> Which workload ensures exactly one Pod runs on every node in the cluster, including future nodes that join?</p>
|
|
127
|
+
<ul>
|
|
128
|
+
<li>A) Deployment with replicas matching node count</li>
|
|
129
|
+
<li>B) ReplicaSet with nodeSelector</li>
|
|
130
|
+
<li>C) DaemonSet ✓</li>
|
|
131
|
+
<li>D) StatefulSet</li>
|
|
132
|
+
</ul>
|
|
133
|
+
<p><em>Explanation: DaemonSet automatically deploys one Pod per node and watches cluster membership — when a new node joins, the DaemonSet controller immediately creates a Pod on it.</em></p>
|
|
134
|
+
|
|
135
|
+
<p><strong>Q3:</strong> A Pod is in 'Pending' state. What is the MOST likely cause?</p>
|
|
136
|
+
<ul>
|
|
137
|
+
<li>A) The container application crashed</li>
|
|
138
|
+
<li>B) No node satisfies the scheduling requirements ✓</li>
|
|
139
|
+
<li>C) The liveness probe failed</li>
|
|
140
|
+
<li>D) The container image is corrupted</li>
|
|
141
|
+
</ul>
|
|
142
|
+
<p><em>Explanation: Pending means the Pod has been accepted but hasn't started. Most common reasons: insufficient CPU/memory on nodes, unsatisfied node affinity/taints, or PVC not bound. Check kubectl describe pod events.</em></p>
|