متقدم
البحث فيالملخصات
طريقة البحث
  • الكلمات تجد عناوين الدروس والنص والكود. صفِّ حسب النوع (أدلة، دورات، برامج، كتب) أو ابقَ في هذا الكتاب.
  • book:rhcsa و ch:8 يضيّقان البحث؛ ‎#code يجد الكلمة داخل أوامر الدروس فقط.
  • "كلمتان" تجد العبارة بالضبط.
  • الكلمات العادية تجد الأسماء والنصوص والأمثلة.
  • ↑ ↓ للتنقل · Enter للفتح · Esc للإغلاق · / للبحث
جرّب:

الدورة 8الاسم في الدورة: Crush the CKAD Exam

Crush the CKAD Exam

Course 8 of 13 in the Alta3 Academy library. Alta3 Academy self-paced course.

ملاحظة

My result — Lessons read: all 27/27; Course progress: 100%.

  • 11 الدروس
  • 6 الأوامر
  • 2 المعامل

هذا الجزء لم يُترجم بعد. أنت ترى النص الإنجليزي.

$ مستخدم عادي# بصلاحية root (أو مع sudo)

8.1

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.

8.2

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-context before you read a task.
  • Tip: tmux is installed in the exam. Start it with tmux. Only kubernetes.io opens in the exam browser.
  • Tip: learn short commands such as kubectl run POD --image=IMG and kubectl 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.

8.3

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, and node-2.
  • fping -A controller node-1 node-2 checks that all hosts answer.
  • Do this lab first. Every mock task needs a running cluster.

8.4

Mock Exam Tasks

Pods and workloads

  • API Primitives: find Pod apricot in namespace pineapple and recreate it in banana. A Pod cannot move, so export the YAML and edit it.
  • Pod Basics: make one Pod named singer with image nginx:1.7.9 and container opera, in namespace talent.
  • Multi-Container Pods: add sidecar kennylogger (image fluentd-gcp:1.30) to Deployment snooper. Share its emptyDir and mount ConfigMap snooper-fluentd at /etc/fluentd-config/fluentd.conf.
  • Deployments: change Pod manticore into a Deployment named manticore-prime with 2 replicas. Save the manifest.
  • DaemonSets: make DaemonSet crowley with nginx:1.7.9 in goodomens. It must run one Pod on every node.
  • Rollbacks: Deployment mufasa in king-of-lions is broken. Read kubectl rollout history and go back to a good revision.
  • Jobs and CronJobs: CronJob kronos runs every minute with busybox:1.31.0 and the command sleep 2 && echo done. Label its Pods fear: his-children. Save one Pod log to kronos-recipes.log.

Config, security, and resources

  • Resource Requirements: Pod zerotohero with memory request 150Mi and memory limit 300Mi.
  • ConfigMaps: build metal-cm from metal.html. Mount it in Deployment enter-sandman at /var/www/index.html in namespace metallica.
  • SecurityContexts: Pod gold-bar runs as user ID 1000 and group ID 2000, with privilege escalation off, command sh -c sleep 1h.
  • Secrets: create Secret juicysecret with username and password. Use them as env vars USERKIWI and PASSKIWI in Pod kiwi-secret-pod.
  • ServiceAccounts: Deployment banana-peel with 2 replicas uses ServiceAccount mega-banana-v5 in namespace banana.
  • Adding Probes: Pod plumpod gets a readiness probe on /health, delay 3s, period 6s, timeout 1s.
  • Container Logging: read logs from vampire-hunter and keep only the lines with nginx. Put them in lincoln-logs.txt.
  • Application Monitoring: run kubectl top pods -n tacos --sort-by cpu and write the busiest Pod name to cpu-consume.txt.

Storage and networking

  • Storage: in namespace exam-only, make PV alta3-pv (2Gi, hostPath /mnt/data, ReadWriteOnce, class manual), PVC nginx-pvc (1Gi), and Pod nginx-with-pv mounted at /data.
  • Services: make Service project-paradise-svc in coconut. Send TCP port 3423 to port 80 on Pod lone-coconut, which has label coconuts=migrate.
  • Network Policies: policy cherry-control blocks egress from Deployment pit, except traffic to stem.
  • Troubleshooting: Deployment in upsetti-spaghetti shows 2 of 3 Pods. A ResourceQuota blocks the third one. Fix only the Deployment.

Helm and exam habits

  • Helm: set replicas: 3 in ~/ckad-helm-task/values.yaml, then run helm install my-release ~/ckad-helm-task. The resources go in namespace battleofhelmsdeep.
  • Most tasks end with a check. Run kubectl get and 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.

8.5

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.

8.6

Continued Learning

The ContainerOrchestration path goes on to CKA, CKS, and Rancher.

  • The path page links each next Alta3 course and its outline.

8.7

Key commands and tools

8.8

Key terms

The words of this course in one table. Learn them before the quiz or exam.

TermMeaning
API primitiveA basic Kubernetes object, such as a Pod, Service, or Namespace.
CKADCertified Kubernetes Application Developer. A hands-on exam from the CNCF and Linux Foundation.
ConfigMapA place to keep config data outside the container image.
CronJobA Job that runs on a time schedule.
DaemonSetA controller that runs one Pod on every node.
DeploymentA controller that manages a ReplicaSet and keeps revision history.
EgressTraffic that leaves a Pod.
Helm chartA package of Kubernetes templates plus a values.yaml file.
JobA workload that runs a command until it finishes.
ManifestA YAML file that says what object you want.
Metrics ServerA cluster add-on that collects CPU and memory data for kubectl top.
NamespaceA slice of a cluster that keeps objects apart.
NetworkPolicyA 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.
ReadinessProbeA check that tells Kubernetes when a container can take traffic.
ReplicaSetA controller that keeps a set number of identical Pods.
RevisionOne saved version of a Deployment.
RollbackA return to an older, working version of a Deployment.
SecretA place to keep private data, such as passwords. It is base64-encoded.
SecurityContextSettings on a Pod or container, such as user ID, group, and privileges.
ServiceAccountThe identity a Pod uses to call the Kubernetes API.
SidecarA helper container that runs next to the main container in one Pod.
StorageClassA rule that lets the cluster create PVs on demand.

الأوامر في هذا الدرس

8.9

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?

تدرّب

كل الأوامر في هذا الفصل