Skip to content

Commit 35a1267

Browse files
committed
ypdate exercices
1 parent f8cb655 commit 35a1267

33 files changed

Lines changed: 1456 additions & 28 deletions

File tree

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
name: Bug / Outdated Content
3+
about: Report incorrect, broken, or outdated content
4+
title: "[Bug] "
5+
labels: bug
6+
assignees: ''
7+
---
8+
9+
**What's wrong?**
10+
<!-- Describe the issue — incorrect YAML, outdated version reference, broken command, etc. -->
11+
12+
**Where?**
13+
<!-- Link to the specific file + section (e.g., README.md > Section 4.2 RBAC, or exercises/05-networkpolicy/README.md) -->
14+
15+
**What should it say?**
16+
<!-- Provide the correct information with a source if possible -->
17+
18+
**Environment (if applicable)**
19+
- Kubernetes version:
20+
- Platform (minikube/kind/cloud):
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
---
2+
name: Exercise Request
3+
about: Suggest a new exercise or practice scenario
4+
title: "[Exercise] "
5+
labels: enhancement
6+
assignees: ''
7+
---
8+
9+
**Topic**
10+
<!-- What CKAD topic should this exercise cover? (e.g., StatefulSet, DaemonSet, NetworkPolicy, etc.) -->
11+
12+
**CKAD Domain**
13+
<!-- Which exam domain does this fall under?
14+
- Application Design and Build (20%)
15+
- Application Deployment (20%)
16+
- Application Observability and Maintenance (15%)
17+
- Application Environment, Configuration, and Security (25%)
18+
- Services and Networking (20%)
19+
-->
20+
21+
**Description**
22+
<!-- Brief description of what the exercise should test -->
23+
24+
**Difficulty**
25+
- [ ] Easy
26+
- [ ] Medium
27+
- [ ] Hard

README.md

Lines changed: 136 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,14 @@
66

77
> My CKAD study notes, practice questions, and kubectl cheat sheet. Kubernetes v1.35. I scored 91% — this is everything I used to prepare.
88
9+
<p align="center">
10+
<a href="https://github.com/techwithmohamed/CKAD-Certified-Kubernetes-Application-Developer/stargazers">
11+
<img src="https://img.shields.io/github/stars/techwithmohamed/CKAD-Certified-Kubernetes-Application-Developer?style=social" alt="Stars">
12+
</a>
13+
</p>
14+
15+
> **⭐ If this repo helps you pass the CKAD, a star helps other candidates find it.**
16+
917
# CKAD Certification Guide 2026 — How I Passed with 91%
1018

1119
<p align="center">
@@ -26,30 +34,39 @@ Short on time? Here's the fast track:
2634

2735
1. **Run the setup script**`bash scripts/exam-setup.sh` to get aliases, vim config, and tab completion
2836
2. **Memorize the skeletons** — skim [`skeletons/`](skeletons/) once, then practice writing each from memory
29-
3. **Do exercises 1, 3, 5, 6, 10** — they cover pods, ConfigMaps, NetworkPolicy, rolling updates, and security (the highest-weighted domains)
30-
4. **Take the mock exam below** — 17 questions, 70% weight coverage. Time yourself (5–8 min per question)
31-
5. **Run killer.sh** — do both sessions. Review every wrong answer. Repeat the weak topics
32-
6. **Read [Exam Day Strategy](#exam-day-strategy) and [Common Mistakes](#mistakes-that-will-fail-you)** the night before
37+
3. **Do exercises 1, 3, 5, 6, 10, 11** — they cover pods, ConfigMaps, NetworkPolicy, rolling updates, security, and StatefulSets (the highest-weighted domains)
38+
4. **Run the interactive quiz**`bash scripts/quiz.sh` for timed practice with auto-verification
39+
5. **Take the mock exam below** — 17 questions, 70% weight coverage. Time yourself (5–8 min per question)
40+
6. **Run killer.sh** — do both sessions. Review every wrong answer. Repeat the weak topics
41+
7. **Read [Exam Day Strategy](#exam-day-strategy) and [Common Mistakes](#mistakes-that-will-fail-you)** the night before
3342

3443
If you score 80%+ on the mock exam **and** 70%+ on killer.sh, you're ready. Book the exam.
3544

45+
> **Every exercise includes a `verify.sh` script** — run it after you attempt the exercise to auto-check your work: `bash exercises/01-pod-basics/verify.sh`
46+
3647
### Repo Structure
3748

3849
```
3950
README.md # This guide
40-
exercises/ # 10 hands-on labs (one per folder)
41-
01-pod-basics/
42-
02-multi-container-pod/
43-
03-configmap-secret/
44-
04-rbac/
45-
05-networkpolicy/
46-
06-rolling-update/
47-
07-helm/
48-
08-probes/
49-
09-ingress-gateway/
50-
10-security-pvc/
51-
skeletons/ # Bare YAML templates for quick reference
52-
scripts/exam-setup.sh # Aliases + vim config (run first thing)
51+
exercises/ # 14 hands-on labs (one per folder, each with verify.sh)
52+
01-pod-basics/ # Easy
53+
02-multi-container-pod/ # Medium
54+
03-configmap-secret/ # Medium
55+
04-rbac/ # Medium
56+
05-networkpolicy/ # Hard
57+
06-rolling-update/ # Medium
58+
07-helm/ # Medium
59+
08-probes/ # Medium
60+
09-ingress-gateway/ # Hard
61+
10-security-pvc/ # Hard
62+
11-statefulset/ # Hard ← NEW
63+
12-daemonset/ # Medium ← NEW
64+
13-init-containers/ # Medium ← NEW
65+
14-in-place-scaling/ # Hard ← NEW (v1.35 GA feature)
66+
skeletons/ # 14 bare YAML templates for quick reference
67+
scripts/
68+
exam-setup.sh # Aliases + vim config (run first thing)
69+
quiz.sh # Interactive terminal quiz with auto-verification
5370
CONTRIBUTING.md
5471
LICENSE
5572
```
@@ -3286,6 +3303,101 @@ spec:
32863303

32873304
</details>
32883305

3306+
<details>
3307+
<summary>StatefulSet + Headless Service</summary>
3308+
3309+
```yaml
3310+
apiVersion: apps/v1
3311+
kind: StatefulSet
3312+
metadata:
3313+
name: myapp
3314+
spec:
3315+
serviceName: myapp-headless
3316+
replicas: 3
3317+
selector:
3318+
matchLabels:
3319+
app: myapp
3320+
template:
3321+
metadata:
3322+
labels:
3323+
app: myapp
3324+
spec:
3325+
containers:
3326+
- name: app
3327+
image: nginx:1.25
3328+
ports:
3329+
- containerPort: 80
3330+
volumeMounts:
3331+
- name: data
3332+
mountPath: /data
3333+
volumeClaimTemplates:
3334+
- metadata:
3335+
name: data
3336+
spec:
3337+
accessModes:
3338+
- ReadWriteOnce
3339+
resources:
3340+
requests:
3341+
storage: 1Gi
3342+
---
3343+
apiVersion: v1
3344+
kind: Service
3345+
metadata:
3346+
name: myapp-headless
3347+
spec:
3348+
clusterIP: None
3349+
selector:
3350+
app: myapp
3351+
ports:
3352+
- port: 80
3353+
targetPort: 80
3354+
```
3355+
3356+
</details>
3357+
3358+
<details>
3359+
<summary>DaemonSet</summary>
3360+
3361+
```yaml
3362+
apiVersion: apps/v1
3363+
kind: DaemonSet
3364+
metadata:
3365+
name: myagent
3366+
spec:
3367+
selector:
3368+
matchLabels:
3369+
app: myagent
3370+
template:
3371+
metadata:
3372+
labels:
3373+
app: myagent
3374+
spec:
3375+
tolerations:
3376+
- key: node-role.kubernetes.io/control-plane
3377+
effect: NoSchedule
3378+
containers:
3379+
- name: agent
3380+
image: fluentd:v1.16-1
3381+
resources:
3382+
requests:
3383+
cpu: 50m
3384+
memory: 64Mi
3385+
limits:
3386+
cpu: 100m
3387+
memory: 128Mi
3388+
volumeMounts:
3389+
- name: host-logs
3390+
mountPath: /var/log
3391+
readOnly: true
3392+
volumes:
3393+
- name: host-logs
3394+
hostPath:
3395+
path: /var/log
3396+
type: Directory
3397+
```
3398+
3399+
</details>
3400+
32893401
<details>
32903402
<summary>SecurityContext</summary>
32913403

@@ -3415,7 +3527,13 @@ The stuff I practiced was the stuff that showed up. If something in this guide i
34153527

34163528
Good luck.
34173529

3418-
If this guide helped you, star the repo.
3530+
If this guide helped you, star the repo. ⭐
3531+
3532+
<p align="center">
3533+
<a href="https://github.com/techwithmohamed/CKAD-Certified-Kubernetes-Application-Developer/stargazers">
3534+
<img src="https://img.shields.io/github/stars/techwithmohamed/CKAD-Certified-Kubernetes-Application-Developer?style=social" alt="Stars">
3535+
</a>
3536+
</p>
34193537

34203538
[techwithmohamed.com](https://techwithmohamed.com/) · [Blog Post](https://techwithmohamed.com/blog/ckad-exam-study-guide/)
34213539

exercises/01-pod-basics/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Exercise 1 — Pod Basics
1+
# Exercise 1 — Pod Basics `Easy`
22

33
> Related: [Application Design and Build](../../README.md#1-application-design-and-build-20) | [YAML Skeleton: Pod](../../skeletons/pod.yaml)
44

exercises/01-pod-basics/verify.sh

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
#!/usr/bin/env bash
2+
# Verify script for Exercise 01 — Pod Basics
3+
# Usage: bash exercises/01-pod-basics/verify.sh
4+
5+
set -euo pipefail
6+
7+
NAMESPACE="exercise-01"
8+
POD_NAME="web"
9+
PASS=0
10+
FAIL=0
11+
12+
check() {
13+
local desc="$1"
14+
local result="$2"
15+
if [ "$result" = "true" ]; then
16+
echo "$desc"
17+
PASS=$((PASS + 1))
18+
else
19+
echo "$desc"
20+
FAIL=$((FAIL + 1))
21+
fi
22+
}
23+
24+
echo "Verifying Exercise 01 — Pod Basics"
25+
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
26+
27+
# Check namespace exists
28+
ns_exists=$(kubectl get namespace "$NAMESPACE" --no-headers 2>/dev/null && echo true || echo false)
29+
check "Namespace '$NAMESPACE' exists" "$ns_exists"
30+
31+
# Check pod exists and is running
32+
pod_phase=$(kubectl get pod "$POD_NAME" -n "$NAMESPACE" -o jsonpath='{.status.phase}' 2>/dev/null || echo "")
33+
check "Pod '$POD_NAME' is Running" "$([ "$pod_phase" = "Running" ] && echo true || echo false)"
34+
35+
# Check image
36+
pod_image=$(kubectl get pod "$POD_NAME" -n "$NAMESPACE" -o jsonpath='{.spec.containers[0].image}' 2>/dev/null || echo "")
37+
check "Image is nginx:1.25" "$([ "$pod_image" = "nginx:1.25" ] && echo true || echo false)"
38+
39+
# Check labels
40+
app_label=$(kubectl get pod "$POD_NAME" -n "$NAMESPACE" -o jsonpath='{.metadata.labels.app}' 2>/dev/null || echo "")
41+
tier_label=$(kubectl get pod "$POD_NAME" -n "$NAMESPACE" -o jsonpath='{.metadata.labels.tier}' 2>/dev/null || echo "")
42+
check "Label app=web" "$([ "$app_label" = "web" ] && echo true || echo false)"
43+
check "Label tier=frontend" "$([ "$tier_label" = "frontend" ] && echo true || echo false)"
44+
45+
# Check resources
46+
cpu_req=$(kubectl get pod "$POD_NAME" -n "$NAMESPACE" -o jsonpath='{.spec.containers[0].resources.requests.cpu}' 2>/dev/null || echo "")
47+
mem_req=$(kubectl get pod "$POD_NAME" -n "$NAMESPACE" -o jsonpath='{.spec.containers[0].resources.requests.memory}' 2>/dev/null || echo "")
48+
cpu_lim=$(kubectl get pod "$POD_NAME" -n "$NAMESPACE" -o jsonpath='{.spec.containers[0].resources.limits.cpu}' 2>/dev/null || echo "")
49+
mem_lim=$(kubectl get pod "$POD_NAME" -n "$NAMESPACE" -o jsonpath='{.spec.containers[0].resources.limits.memory}' 2>/dev/null || echo "")
50+
check "CPU request 100m" "$([ "$cpu_req" = "100m" ] && echo true || echo false)"
51+
check "Memory request 128Mi" "$([ "$mem_req" = "128Mi" ] && echo true || echo false)"
52+
check "CPU limit 250m" "$([ "$cpu_lim" = "250m" ] && echo true || echo false)"
53+
check "Memory limit 256Mi" "$([ "$mem_lim" = "256Mi" ] && echo true || echo false)"
54+
55+
echo ""
56+
echo "Result: $PASS passed, $FAIL failed out of $((PASS + FAIL)) checks"
57+
[ "$FAIL" -eq 0 ] && echo "🎉 Exercise 01 PASSED!" || echo "❌ Exercise 01 has failures — review and retry."

exercises/02-multi-container-pod/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Exercise 2 — Multi-Container Pod (Sidecar)
1+
# Exercise 2 — Multi-Container Pod (Sidecar) `Medium`
22

33
> Related: [Application Design and Build](../../README.md#1-application-design-and-build-20) | [What Changed in v1.35](../../README.md#what-changed-in-v135) | [YAML Skeleton: Pod](../../skeletons/pod.yaml)
44
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
#!/usr/bin/env bash
2+
# Verify script for Exercise 02 — Multi-Container Pod (Sidecar)
3+
# Usage: bash exercises/02-multi-container-pod/verify.sh
4+
5+
set -euo pipefail
6+
7+
NAMESPACE="exercise-02"
8+
POD_NAME="app-with-sidecar"
9+
PASS=0
10+
FAIL=0
11+
12+
check() {
13+
local desc="$1"
14+
local result="$2"
15+
if [ "$result" = "true" ]; then
16+
echo "$desc"
17+
PASS=$((PASS + 1))
18+
else
19+
echo "$desc"
20+
FAIL=$((FAIL + 1))
21+
fi
22+
}
23+
24+
echo "Verifying Exercise 02 — Multi-Container Pod (Sidecar)"
25+
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
26+
27+
ns_exists=$(kubectl get namespace "$NAMESPACE" --no-headers 2>/dev/null && echo true || echo false)
28+
check "Namespace '$NAMESPACE' exists" "$ns_exists"
29+
30+
pod_phase=$(kubectl get pod "$POD_NAME" -n "$NAMESPACE" -o jsonpath='{.status.phase}' 2>/dev/null || echo "")
31+
check "Pod '$POD_NAME' is Running" "$([ "$pod_phase" = "Running" ] && echo true || echo false)"
32+
33+
# Check container count
34+
container_count=$(kubectl get pod "$POD_NAME" -n "$NAMESPACE" -o jsonpath='{.spec.containers[*].name}' 2>/dev/null | wc -w || echo 0)
35+
check "Pod has 2 containers" "$([ "$container_count" -eq 2 ] && echo true || echo false)"
36+
37+
# Check container names
38+
containers=$(kubectl get pod "$POD_NAME" -n "$NAMESPACE" -o jsonpath='{.spec.containers[*].name}' 2>/dev/null || echo "")
39+
check "Container 'app' exists" "$(echo "$containers" | grep -q 'app' && echo true || echo false)"
40+
check "Container 'log-agent' exists" "$(echo "$containers" | grep -q 'log-agent' && echo true || echo false)"
41+
42+
# Check shared volume
43+
vol_count=$(kubectl get pod "$POD_NAME" -n "$NAMESPACE" -o jsonpath='{.spec.volumes[*].name}' 2>/dev/null | wc -w || echo 0)
44+
check "Shared volume exists" "$([ "$vol_count" -ge 1 ] && echo true || echo false)"
45+
46+
# Check sidecar is producing logs
47+
sidecar_logs=$(kubectl logs "$POD_NAME" -n "$NAMESPACE" -c log-agent --tail=1 2>/dev/null || echo "")
48+
check "Sidecar is streaming logs" "$([ -n "$sidecar_logs" ] && echo true || echo false)"
49+
50+
echo ""
51+
echo "Result: $PASS passed, $FAIL failed out of $((PASS + FAIL)) checks"
52+
[ "$FAIL" -eq 0 ] && echo "🎉 Exercise 02 PASSED!" || echo "❌ Exercise 02 has failures — review and retry."

exercises/03-configmap-secret/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Exercise 3 — ConfigMap + Secret Injection
1+
# Exercise 3 — ConfigMap + Secret Injection `Medium`
22

33
> Related: [Environment, Configuration, and Security](../../README.md#4-application-environment-configuration-and-security-25) | [YAML Skeleton: ConfigMap + Secret](../../skeletons/configmap-secret.yaml)
44

0 commit comments

Comments
 (0)