انتقل إلى المحتوى
أمين أبوزيد
MID-057

أساسيات Kubernetes

  • 10 درس
  • 4 ساعة تدريب (تقدير)
في هذه الصفحة 8 موضوعات

نص الدروس والتمارين باللغة الإنجليزية، بينما تبقى واجهة الموقع وعناوين الدروس بالعربية.

نظرة عامة

الموضوعات

  • Pods
  • Deployments
  • Services
  • ConfigMaps
  • Secrets
  • الفحوصات (probes)
  • التوسع التلقائي (autoscaling)

تعلّم أولًا

4 ساعة تدريب (تقدير)

مخرجات التعلم

  1. Explain the control plane, nodes, and the desired-state model.
  2. Deploy services with Deployments, Services, ConfigMaps, and Secrets.
  3. Configure liveness, readiness, and startup probes plus resource requests and limits for JVM services.
  4. Scale with the Horizontal Pod Autoscaler and perform rolling updates.
  5. Debug pods (describe, logs, exec, events).

الدروس

  1. 01لماذا Kubernetes
  2. 02البنية والحالة المطلوبة (Desired state)
  3. 03Pods وDeployments
  4. 04Services وIngress
  5. 05ConfigMaps وSecrets
  6. 06الفحوصات (Probes) لخدمات JVM
  7. 07الطلبات والحدود والتوسع التلقائي
  8. 08تشخيص مشكلات الـ Pods
  9. 09عرض عملي: نشر Shop Platform على عنقود (cluster)
  10. 10عرض عملي: Pod يتعطل ويعيد التشغيل باستمرار وتشخيص سببه

المختبر والتمارين

Lab

MID-057-LAB1 · Shop on Kubernetes

Outcomes: 1–5 · Time: ~4 h Deploy all Shop services, Kafka (operator or managed), and the gateway to a cluster (kind, k3d, or managed). Use Deployments, Services, an Ingress, ConfigMaps, and Secrets. Configure startup, readiness, and liveness probes and resource requests and limits for each JVM service, and an HPA on orders. Acceptance: a rolling update under load with zero failed requests.

Exercises (assessment: debugging a broken manifest set)

IDOutcomeTask
MID-057-EX011Explain what happens between kubectl apply and a running pod.
MID-057-EX022Write the Deployment, Service, and ConfigMap for inventory.
MID-057-EX033Fix this probe set: liveness calls an endpoint that queries the database; no startup probe.
MID-057-EX043Set requests, limits, and JVM heap flags for a service using about 600 MB of heap.
MID-057-EX054Add an HPA to orders and a rolling update strategy with no lost capacity.
MID-057-EX065Debug the provided manifests: ImagePullBackOff, a wrong Service selector, and an OOMKilled pod.
أظهر الحلول
  • EX01 API server stores the object in etcd; a controller creates a ReplicaSet and pods; the scheduler assigns a node; the kubelet pulls the image and starts containers.
  • EX02 Deployment with a pinned image and labels; Service selecting app: inventory; ConfigMap via envFrom.
  • EX03 Liveness checks only that the process is alive (/actuator/health/liveness); readiness may reflect dependencies; add a startup probe with a generous failure threshold.
  • EX04 Example: memory request and limit 1 Gi, -XX:MaxRAMPercentage=70, CPU request 500m; verify by observing the pod under load.
  • EX05 HorizontalPodAutoscaler minReplicas 3, maxReplicas 10, CPU 70%; maxSurge: 1, maxUnavailable: 0.
  • EX06 describe shows the wrong tag or registry credentials; compare Service selector with pod labels (kubectl get endpoints is empty); OOMKilled: raise the limit or reduce heap after checking usage.

Outcome 1 is also covered by quiz Q01–Q02; the other outcomes by the lab and the debugging exercise.

الاختبار

Outcomes: O1 architecture and desired state · O2 core objects · O3 probes and resources · O4 scaling and rolling updates · O5 debugging.

اختبار ذاتي لك: لا توجد درجات، ولا يُحفظ أو يُرسل أي شيء. اختر إجابة ثم تحقق منها، ويمكنك المحاولة مرة أخرى كما تشاء.

  1. 1Kubernetes stores cluster state in:O1
  2. 2Controllers work by:O1
  3. 3A Deployment provides:O2
  4. 4Why call a Service by name?O2
  5. 5A Kubernetes Secret by default is:O2
  6. 6A liveness probe should:O3
  7. 7A startup probe helps JVM services by:O3
  8. 8A pod exceeding its memory limit is:O3
  9. 9The HPA changes:O4
  10. 10To see logs of the container that just crashed:O5

الجزء العملي

Debugging exercise (MID-057-EX06) plus lab MID-057-LAB1. Pass: quiz at least 8/10, all Shop services running with probes, limits, and HPA, and a rolling update under load with zero failed requests.

أخطاء شائعة

Liveness probes that check the database; no memory limits for JVMs; latest tags.

التقييم

Debugging exercise on a broken manifest set.

الصلة بالمسار الوظيفي

Platform engineering (SRB-010) and the MID capstone.

اكتب للبحث في المستويات والمراحل والوحدات والدروس.