Dit deel is nog niet vertaald. Je ziet de Engelse tekst.
$ als gewone gebruiker# als root (of met sudo)
What the course covers
A full practice exam for the Certified Kubernetes Application Developer (CKAD) certificate.
- 21 hands-on tasks. Each one looks like a real exam task.
- The real exam format: 120 minutes, 17 to 19 tasks, no multiple choice.
- How to build the practice cluster with an Alta3 Ansible playbook.
- Exam speed skills: tmux, vim, kubectl shortcuts, and the Kubernetes docs.
- Workloads, config, security, storage, networking, Helm, and troubleshooting.
- A teardown script so you can reset the cluster and try the exam again.
Let's Crush the CKAD!
The welcome lesson explains the lab, and VIRGIL is the lab coach you can ask for help.
- Each task page has the same parts: Objective, Summary, Tasks, Hints, Answers, and Teardown.
- The real exam is task based. You work in a terminal, not in a quiz.
- Tip: practice until you are fast. Learn where things are in the Kubernetes docs before exam day.
- Tip: run
kubectl config use-contextbefore you read a task. - Tip: tmux is installed in the exam. Start it with
tmux. Onlykubernetes.ioopens in the exam browser. - Tip: learn short commands such as
kubectl run POD --image=IMGandkubectl create deploy NAME --image=IMG --replicas=N. - Name each manifest after its task, for example
3-deploy.yaml. Copy image names instead of retyping them.
Before You Start
The practice cluster comes from the Alta3 playbook kubernetes-the-alta3-way.
- The lab has four machines:
bchd(your terminal), one controller,node-1, andnode-2. fping -A controller node-1 node-2checks that all hosts answer.- Do this lab first. Every mock task needs a running cluster.
Mock Exam Tasks
Pods and workloads
- API Primitives: find Pod
apricotin namespacepineappleand recreate it inbanana. A Pod cannot move, so export the YAML and edit it. - Pod Basics: make one Pod named
singerwith imagenginx:1.7.9and containeropera, in namespacetalent. - Multi-Container Pods: add sidecar
kennylogger(imagefluentd-gcp:1.30) to Deploymentsnooper. Share its emptyDir and mount ConfigMapsnooper-fluentdat/etc/fluentd-config/fluentd.conf. - Deployments: change Pod
manticoreinto a Deployment namedmanticore-primewith 2 replicas. Save the manifest. - DaemonSets: make DaemonSet
crowleywithnginx:1.7.9ingoodomens. It must run one Pod on every node. - Rollbacks: Deployment
mufasainking-of-lionsis broken. Readkubectl rollout historyand go back to a good revision. - Jobs and CronJobs: CronJob
kronosruns every minute withbusybox:1.31.0and the commandsleep 2 && echo done. Label its Podsfear: his-children. Save one Pod log tokronos-recipes.log.
Config, security, and resources
- Resource Requirements: Pod
zerotoherowith memory request150Miand memory limit300Mi. - ConfigMaps: build
metal-cmfrommetal.html. Mount it in Deploymententer-sandmanat/var/www/index.htmlin namespacemetallica. - SecurityContexts: Pod
gold-barruns as user ID 1000 and group ID 2000, with privilege escalation off, commandsh -c sleep 1h. - Secrets: create Secret
juicysecretwithusernameandpassword. Use them as env varsUSERKIWIandPASSKIWIin Podkiwi-secret-pod. - ServiceAccounts: Deployment
banana-peelwith 2 replicas uses ServiceAccountmega-banana-v5in namespacebanana. - Adding Probes: Pod
plumpodgets a readiness probe on/health, delay 3s, period 6s, timeout 1s. - Container Logging: read logs from
vampire-hunterand keep only the lines withnginx. Put them inlincoln-logs.txt. - Application Monitoring: run
kubectl top pods -n tacos --sort-by cpuand write the busiest Pod name tocpu-consume.txt.
Storage and networking
- Storage: in namespace
exam-only, make PValta3-pv(2Gi, hostPath/mnt/data,ReadWriteOnce, classmanual), PVCnginx-pvc(1Gi), and Podnginx-with-pvmounted at/data. - Services: make Service
project-paradise-svcincoconut. Send TCP port 3423 to port 80 on Podlone-coconut, which has labelcoconuts=migrate. - Network Policies: policy
cherry-controlblocks egress from Deploymentpit, except traffic tostem. - Troubleshooting: Deployment in
upsetti-spaghettishows 2 of 3 Pods. A ResourceQuota blocks the third one. Fix only the Deployment.
Helm and exam habits
- Helm: set
replicas: 3in~/ckad-helm-task/values.yaml, then runhelm install my-release ~/ckad-helm-task. The resources go in namespacebattleofhelmsdeep. - Most tasks end with a check. Run
kubectl getand confirm before you move on. - You can go back to any task. Name your files well so you can find them again.
- Use the hints to learn. Then close them and do the task again from memory.
Refresh Environment
bash ~/git/kubernetes-the-alta3-way/labs/drill/teardown.sh deletes all your work.
- Run it when you want a clean cluster and a second full attempt.
Continued Learning
The ContainerOrchestration path goes on to CKA, CKS, and Rancher.
- The path page links each next Alta3 course and its outline.
Key commands and tools
kubectl config use-context NAME— point kubectl at the right cluster.drill TASK-NAME— build the objects for one mock task.kubectl get pods -n NSandkubectl get deploy -n NS— check what exists.kubectl get pod NAME -o yaml > file.yaml— export a manifest.kubectl get pods -n pineapple apricot -o json— read one Pod in JSON.kubectl apply -f file.yaml— create or update an object.kubectl describe rs -n NSandkubectl describe deploy -n NS— read events.kubectl rollout history deployment -n NS NAME— list revisions.kubectl rollout undo deployment -n NS NAME --to-revision=N— go back one version.kubectl scale deploy -n NS NAME --replicas=3— fix the replica count.kubectl top pods -n NS --sort-by cpu— find the busiest Pod.kubectl logs -n NS POD— read container logs.kubectl logs -n NS POD | grep nginx > file.txt— filter logs into a file.kubectl exec -n NS POD -it -- bash— open a shell in a container.kubectl port-forward -n NS POD 2224:9876— test a Pod from your machine.helm install NAME ./chartandhelm upgrade NAME ./chart -f values.yaml— deploy a chart.fping -A controller node-1 node-2— test host reachability.bash ~/git/kubernetes-the-alta3-way/labs/drill/teardown.sh— reset the lab.
Key terms
The words of this course in one table. Learn them before the quiz or exam.
| Term | Meaning |
|---|---|
| API primitive | A basic Kubernetes object, such as a Pod, Service, or Namespace. |
| CKAD | Certified Kubernetes Application Developer. A hands-on exam from the CNCF and Linux Foundation. |
| ConfigMap | A place to keep config data outside the container image. |
| CronJob | A Job that runs on a time schedule. |
| DaemonSet | A controller that runs one Pod on every node. |
| Deployment | A controller that manages a ReplicaSet and keeps revision history. |
| Egress | Traffic that leaves a Pod. |
| Helm chart | A package of Kubernetes templates plus a values.yaml file. |
| Job | A workload that runs a command until it finishes. |
| Manifest | A YAML file that says what object you want. |
| Metrics Server | A cluster add-on that collects CPU and memory data for kubectl top. |
| Namespace | A slice of a cluster that keeps objects apart. |
| NetworkPolicy | A firewall rule for Pods. It allows or blocks ingress and egress. |
| PersistentVolume (PV) | Real storage in the cluster. |
| PersistentVolumeClaim (PVC) | A request for storage that a Pod can mount. |
| ReadinessProbe | A check that tells Kubernetes when a container can take traffic. |
| ReplicaSet | A controller that keeps a set number of identical Pods. |
| Revision | One saved version of a Deployment. |
| Rollback | A return to an older, working version of a Deployment. |
| Secret | A place to keep private data, such as passwords. It is base64-encoded. |
| SecurityContext | Settings on a Pod or container, such as user ID, group, and privileges. |
| ServiceAccount | The identity a Pod uses to call the Kubernetes API. |
| Sidecar | A helper container that runs next to the main container in one Pod. |
| StorageClass | A rule that lets the cluster create PVs on demand. |
Check yourself
Answer each question first, then open it to check the answer.
1Can you move a running Pod from one namespace to another?
No. A Pod cannot change namespace. Export its YAML, edit the namespace, and create it again.
2Which command shows the revision history of a Deployment?
3Where do you change the number of replicas in a Helm chart?
In the chart's values.yaml file, under replicas.
4Why is the third Pod missing in the troubleshooting task?
A ResourceQuota in the namespace limits CPU. The ReplicaSet cannot create the third Pod.
5How do you keep only the nginx lines from a Pod log in a file?
Useful links
Official documentation and pages for this course.