Contents

    Container Orchestration · KubernetesBeginner8 min read

    Last updated ·

    Why Kubernetes?

    Understand why container management becomes complex at scale and how Kubernetes helps with orchestration, scaling, scheduling, networking, recovery, and application updates.

    • kubernetes
    • container-orchestration
    • fundamentals
    Edit on GitHub

    Introduction

    ? Why Kubernetes

    بعد ما فهمنا What Kubernetes Is، السؤال الطبيعي هو:

    Why do we need Kubernetes in the first place?

    لو عندي Container واحدة أو Application صغيرة، ممكن أشغّلها وأديرها بسهولة باستخدام Docker أو أدوات تانية.

    لكن مع زيادة حجم الـApplication والـInfrastructure، إدارة الـContainers يدويًا بتصبح أصعب؛ لأن الموضوع مش مجرد تشغيل Containers، لكن كمان Scheduling وNetworking وScaling وRecovery وUpdates.

    عشان كده Kubernetes بيوفر Platform لإدارة الـContainerized Workloads على مستوى الـCluster.

    1. The Problem with Managing Containers Manually

    في البداية، ممكن يكون عندنا Application بسيطة بتشتغل على Server واحدة.

    flowchart TD
        APP(["Application"]) --> CONTAINER(["Container"])
        CONTAINER --> SERVER(["Server"])
    
        classDef app fill:#eef3f1,stroke:#78968c,stroke-width:2px,color:#2f403a;
        classDef runtime fill:#eef3f1,stroke:#78968c,stroke-width:2px,color:#2f403a;
    
        class APP app;
        class CONTAINER runtime;
        class SERVER app;

    في الحالة دي، تشغيل الـContainer ومتابعتها مش بالضرورة يكون معقدًا.

    لكن تخيل إن الـApplication كبرت وبقت مكونة من Frontend وBackend API وBackground Workers، وكل جزء منه عنده عدة Instances.

    flowchart TD
        APP(["Application"])
    
        APP --> FE(["Frontend"])
        APP --> API(["Backend API"])
        APP --> WORKER(["Background Workers"])
    
        FE --> FE1(["Frontend Pod"])
        FE --> FE2(["Frontend Pod"])
    
        API --> API1(["API Pod 1"])
        API --> API2(["API Pod 2"])
        API --> API3(["API Pod 3"])
    
        WORKER --> W1(["Worker Pod"])
        WORKER --> W2(["Worker Pod"])
    
        classDef app fill:#eef3f1,stroke:#78968c,stroke-width:2px,color:#2f403a;
        classDef service fill:#eef3f1,stroke:#78968c,stroke-width:2px,color:#2f403a;
        classDef workload fill:#eef3f1,stroke:#78968c,stroke-width:2px,color:#2f403a;
    
        class APP app;
        class FE,API,WORKER service;
        class FE1,FE2,API1,API2,API3,W1,W2 workload;

    ولو الـWorkloads دي موزعة على Machines مختلفة، هتحتاج تتعامل مع أسئلة تشغيلية أكتر:

    • فين كل Workload المفروض تشتغل؟
    • إيه اللي يحصل لو Instance تعطلت؟
    • إزاي نوزع الـTraffic؟
    • إزاي نزود عدد الـInstances وقت الضغط؟
    • إزاي نحدّث التطبيق تدريجيًا؟
    • إزاي نضمن إن الـResources المتاحة تكفي؟
    • إزاي نكتشف المشاكل ونتعامل معاها؟

    المشكلة الأساسية هنا مش إن تشغيل Container صعب، لكن إن إدارة عدد كبير من الـWorkloads بصورة متناسقة وموثوقة بتصبح معقدة.

    2. Scaling and Resource Management

    Scaling Applications

    افترض إن عندنا API شغالة بنسخة واحدة، وبعد فترة الـTraffic زاد.

    في البداية:

    flowchart TD
        TRAFFIC(["Incoming Traffic"]) --> API(["API Instance"])
    
        classDef input fill:#f5efe6,stroke:#b08b62,stroke-width:2px,color:#3d3329;
        classDef workload fill:#eef3f1,stroke:#78968c,stroke-width:2px,color:#2f403a;
    
        class TRAFFIC input;
        class API workload;

    ومع زيادة الحمل، ممكن نحتاج أكتر من Instance.

    flowchart TD
        TRAFFIC(["Incoming Traffic"]) --> API(["API Service"])
    
        API --> P1(["API Pod 1"])
        API --> P2(["API Pod 2"])
        API --> P3(["API Pod 3"])
        API --> P4(["API Pod 4"])
    
        classDef input fill:#f5efe6,stroke:#b08b62,stroke-width:2px,color:#3d3329;
        classDef service fill:#eef3f1,stroke:#78968c,stroke-width:2px,color:#2f403a;
        classDef pod fill:#eef3f1,stroke:#78968c,stroke-width:2px,color:#2f403a;
    
        class TRAFFIC input;
        class API service;
        class P1,P2,P3,P4 pod;

    لكن زيادة عدد الـInstances مش مجرد تشغيل Containers إضافية. لازم نراعي:

    • هل فيه CPU وMemory كفاية؟
    • هل الـNodes تقدر تستضيف الـPods الجديدة؟
    • هل الـApplication قادرة تتعامل مع أكتر من Instance؟
    • إزاي الـTraffic هيوصل للـInstances؟
    • إمتى نزود العدد وإمتى نقلله؟

    Kubernetes بيساعد في إدارة الـReplicas والـScheduling والـResource Allocation، وبيوفر آليات للـAutoscaling عند إعدادها بالشكل المناسب.

    3. What Happens When a Workload Fails?

    Self-Healing

    واحدة من المشاكل المهمة في تشغيل الـApplications هي التعامل مع الأعطال.

    افترض إننا محتاجين 3 Replicas من Application.

    flowchart LR
        DESIRED(["Desired: 3 Replicas"]) --> CURRENT(["Current: 3 Pods"])
    
        classDef state fill:#f5efe6,stroke:#b08b62,stroke-width:2px,color:#3d3329;
    
        class DESIRED,CURRENT state;

    لو واحدة من الـPods اختفت أو اتوقفت، الحالة الفعلية هتختلف عن الحالة المطلوبة.

    flowchart TD
        DESIRED(["Desired Replicas: 3"])
    
        subgraph CURRENT["Current Workload"]
            direction LR
            P1(["Pod 1"])
            P2(["Pod 2"])
        end
    
        DESIRED --> RECON(["Controller Reconciliation"])
        CURRENT --> RECON
    
        RECON --> ACTION(["Create Replacement Pod"])
        ACTION --> RESULT(["Workload Returns Toward 3 Replicas"])
    
        classDef state fill:#f5efe6,stroke:#b08b62,stroke-width:2px,color:#3d3329;
        classDef process fill:#f5efe6,stroke:#b08b62,stroke-width:2px,color:#3d3329;
    
        class DESIRED,P1,P2,RESULT state;
        class RECON,ACTION process;
    
        style CURRENT fill:#FAF5EC,stroke:#B99A6A,stroke-width:1.5px,color:#3D3329;

    لو عندنا Deployment، فالـDeployment Controller بيدير ReplicaSet، والـReplicaSet Controller بيحاول يحافظ على عدد الـPods المطلوب.

    لو Pod اختفت، الـReplicaSet Controller ممكن ينشئ Pod بديلة.

    ده مثال على Self-Healing.

    لكن لازم نفهم إن Kubernetes مش بيصلح كل أنواع الأعطال.

    What Kubernetes Can Do

    إعادة إنشاء Pods مفقودة، وإعادة تشغيل Containers في حالات معينة، ومحاولة استعادة الحالة المطلوبة.

    What It Cannot Guarantee

    إصلاح Bugs داخل التطبيق، أو استعادة بيانات مفقودة، أو ضمان توافر الخدمة في كل الظروف.

    كمان فيه فرق بين إن الـPod تكون موجودة وإنها تكون Ready to Serve Traffic. ممكن Pod بديلة تتنشأ بنجاح، لكن تفضل غير جاهزة لاستقبال الطلبات.

    4. Scheduling Across Multiple Machines

    Workload Scheduling

    في Cluster مكون من عدة Nodes، مش كل Node عندها نفس الإمكانيات أو الظروف.

    ممكن تختلف في:

    • CPU and Memory Capacity
    • Available Resources
    • Node Labels and Taints
    • Scheduling Constraints
    • Affinity and Anti-Affinity Rules

    السؤال هنا:

    Where should each Pod run?

    flowchart TD
        POD(["New Pod"]) --> SCHEDULER(["Kubernetes Scheduler"])
    
        SCHEDULER --> CHECK{"Suitable Node?"}
    
        CHECK --> NODE1(["Node 1"])
        CHECK --> NODE2(["Node 2"])
        CHECK --> NODE3(["Node 3"])
    
        classDef workload fill:#eef3f1,stroke:#78968c,stroke-width:2px,color:#2f403a;
        classDef process fill:#f5efe6,stroke:#b08b62,stroke-width:2px,color:#3d3329;
        classDef node fill:#f1eee8,stroke:#9b8f7e,stroke-width:2px,color:#3d3933;
    
        class POD workload;
        class SCHEDULER process;
        class CHECK node;
        class NODE1,NODE2,NODE3 node;

    الـKubernetes Scheduler بيختار Node مناسبة للـPod بناءً على الـResource Requests والقيود والسياسات ذات الصلة.

    لكن الـScheduler مش بيشغّل الـContainer بنفسه؛ هو بيحدد الـNode اللي الـPod هتتجدول عليها، وبعد كده مكونات الـNode بتتولى تشغيلها.

    5. Networking and Service Discovery

    في الـModern Applications، غالبًا بيكون عندنا Services متعددة محتاجة تتواصل مع بعضها.

    مثلًا:

    flowchart LR
        FRONTEND(["Frontend"]) --> API(["Backend Service"])
        API --> PODS(["Backend Pods"])
        PODS --> DATABASE(["Database Service"])
        DATABASE --> DBPODS(["Database Pods"])
    
        classDef app fill:#eef3f1,stroke:#78968c,stroke-width:2px,color:#2f403a;
        classDef service fill:#eef3f1,stroke:#78968c,stroke-width:2px,color:#2f403a;
        classDef pods fill:#eef3f1,stroke:#78968c,stroke-width:2px,color:#2f403a;
    
        class FRONTEND app;
        class API,DATABASE service;
        class PODS,DBPODS pods;

    الـPods ممكن تتغير أو تتعاد إنشاؤها، وبالتالي عناوين الـIP الخاصة بيها ممكن تتغير.

    علشان كده Kubernetes بيوفر Services بتقدم Endpoints مستقرة نسبيًا للوصول إلى مجموعات من الـPods، حسب نوع الـService وإعداداتها.

    ومن خلال الـCluster Networking وآليات Service Discovery، تقدر الـApplications تتواصل مع بعضها بدون ما تحتاج تعتمد على معرفة عنوان IP ثابت لكل Pod.

    من المهم نفهم إن الـService والـNetworking مش مسؤولية Component واحدة في كل الحالات؛ تنفيذ الشبكات بيعتمد على الـCNI Plugin ومكونات الـCluster وإعداداته.

    6. Application Updates and Rolling Deployments

    Rolling Updates

    افترض إن عندنا Application شغالة باستخدام Version 1.0، وعايزين نحدّثها إلى Version 2.0.

    لو وقفنا كل الـInstances القديمة قبل تشغيل الجديدة، ممكن يحصل Downtime.

    الـDeployment في Kubernetes بيدعم Rolling Updates، اللي بتسمح باستبدال الـPods تدريجيًا وفق استراتيجية التحديث والإعدادات المحددة.

    flowchart TD
        OLD(["Version 1.0"])
        MIXED(["Rolling Update"])
        NEW(["Version 2.0"])
    
        OLD --> MIXED
        MIXED --> NEW
    
        subgraph TRANSITION["During the Update"]
            direction LR
            OLD1(["Old Pod"])
            NEW1(["New Pod"])
            OLD1 -.-> NEW1
        end
    
        classDef old fill:#f5efe6,stroke:#b08b62,stroke-width:2px,color:#3d3329;
        classDef update fill:#f5efe6,stroke:#b08b62,stroke-width:2px,color:#3d3329;
        classDef new fill:#f5efe6,stroke:#b08b62,stroke-width:2px,color:#3d3329;
    
        class OLD,OLD1 old;
        class MIXED update;
        class NEW,NEW1 new;
    
        style TRANSITION fill:#FAF5EC,stroke:#B99A6A,stroke-width:1.5px,color:#3D3329;

    الفكرة إن Kubernetes يقدر يدير الانتقال التدريجي من الـOld ReplicaSet إلى الـNew ReplicaSet.

    لكن Rolling Updates مش ضمان مطلق لعدم حدوث Downtime. النتيجة بتعتمد على عوامل زي:

    • Readiness Probes
    • maxSurge and maxUnavailable
    • توفر الـCluster Resources
    • صحة الـApplication الجديدة
    • توافق الـVersions مع البيانات والـDependencies

    7. Desired State and Declarative Management

    Declarative Management

    من أهم أسباب استخدام Kubernetes إننا مش محتاجين نعتمد بالكامل على سلسلة من الإجراءات اليدوية.

    بدل ما نطلب تنفيذ كل خطوة لوحدها، بنحدد الحالة المطلوبة.

    مثلًا:

    spec:
      replicas: 3

    القيمة دي جزء من الـConfiguration بتاعة Resource، وبتحدد عدد الـReplicas المطلوبة في الـWorkload المناسبة.

    flowchart TD
        CONFIG(["Desired Configuration"])
        CURRENT(["Current Cluster State"])
    
        CONFIG --> COMPARE{"State Matches?"}
        CURRENT --> COMPARE
    
        COMPARE -->|Yes| OBSERVE(["Continue Observing"])
        COMPARE -->|No| ACTION(["Controller Takes Action"])
    
        ACTION --> UPDATED(["Updated Cluster State"])
        UPDATED -.-> CURRENT
        OBSERVE -.-> CURRENT
    
        classDef config fill:#f1eee8,stroke:#9b8f7e,stroke-width:2px,color:#3d3933;
        classDef state fill:#f5efe6,stroke:#b08b62,stroke-width:2px,color:#3d3329;
        classDef process fill:#f5efe6,stroke:#b08b62,stroke-width:2px,color:#3d3329;
    
        class CONFIG config;
        class CURRENT,UPDATED state;
        class COMPARE,OBSERVE,ACTION process;

    الـControllers بتراقب الـResources اللي مسؤولة عنها، وبتحاول معالجة الاختلافات بين الـDesired State والـCurrent State.

    وده جوهر الـReconciliation Loop.

    لكن تحقيق الحالة المطلوبة مش مضمون في كل الظروف؛ ممكن مثلًا الـCluster يكون عنده نقص في الموارد أو قيود تمنع تشغيل Pod جديدة.

    8. Resource Management

    الـApplications المختلفة بتحتاج موارد مختلفة.

    مثلًا، Application بسيطة ممكن تحتاج CPU وMemory أقل من Background Worker بيعمل Processing مكثف.

    flowchart TD
        CLUSTER(["Cluster Resources"])
    
        CLUSTER --> NODE1(["Node 1"])
        CLUSTER --> NODE2(["Node 2"])
    
        NODE1 --> POD1(["Lightweight Workload"])
        NODE2 --> POD2(["Resource-Intensive Workload"])
    
        classDef cluster fill:#f3eef4,stroke:#9a7fa0,stroke-width:2px,color:#3e3342;
        classDef node fill:#f1eee8,stroke:#9b8f7e,stroke-width:2px,color:#3d3933;
        classDef pod fill:#eef3f1,stroke:#78968c,stroke-width:2px,color:#2f403a;
    
        class CLUSTER cluster;
        class NODE1,NODE2 node;
        class POD1,POD2 pod;

    Kubernetes بيسمح بتحديد CPU وMemory Requests وLimits للـContainers.

    • Requests: بتحدد الموارد المطلوبة لأغراض منها الـScheduling.
    • Limits: بتحط حدود لاستهلاك بعض الموارد، وفق طبيعة المورد وآلية تطبيق الحد.

    الـRequests والـLimits بيساعدوا في تنظيم استخدام الموارد، لكنهم مش بيخلقوا موارد إضافية، ومش بيضمنوا إن كل Application هتشتغل بأفضل أداء.

    كمان الـScheduler بيستخدم الـRequests في تقييم إمكانية وضع Pod على Node، مش مجرد مقارنة الاستهلاك اللحظي للـCPU والـMemory.

    9. High Availability and Reliability

    في بيئات Production، غالبًا مش عايزين Application تعتمد على Server واحدة فقط.

    flowchart TD
        APP(["Application Workload"])
    
        APP --> POD1(["Replica 1"])
        APP --> POD2(["Replica 2"])
        APP --> POD3(["Replica 3"])
    
        POD1 --> NODE1(["Node 1"])
        POD2 --> NODE2(["Node 2"])
        POD3 --> NODE3(["Node 3"])
    
        classDef app fill:#eef3f1,stroke:#78968c,stroke-width:2px,color:#2f403a;
        classDef pod fill:#eef3f1,stroke:#78968c,stroke-width:2px,color:#2f403a;
        classDef node fill:#f1eee8,stroke:#9b8f7e,stroke-width:2px,color:#3d3933;
    
        class APP app;
        class POD1,POD2,POD3 pod;
        class NODE1,NODE2,NODE3 node;

    توزيع الـReplicas على Nodes مختلفة ممكن يساعد في تقليل تأثير تعطل Node واحدة.

    لكن مجرد إنشاء 3 Replicas مش معناه إنهم هيتوزعوا تلقائيًا على 3 Nodes مختلفة؛ التوزيع بيعتمد على Scheduling Decisions والـConstraints والسياسات المستخدمة.

    ولتحقيق مستوى مناسب من الـHigh Availability، لازم نراعي:

    • توزيع الـReplicas على Failure Domains مختلفة عند الحاجة.
    • توفر موارد كافية.
    • إعداد الـReadiness وLiveness Probes بشكل صحيح.
    • تصميم الـApplication لتحمل الأعطال.
    • توفير Storage وNetworking مناسبين.
    • تجنب Single Points of Failure في الـInfrastructure والـDependencies.

    10. From Manual Operations to Automation

    لما الـEnvironment تكبر، عدد العمليات اللي محتاجين نديرها بيزيد.

    Manual Deployment

    تنفيذ إجراءات متكررة لتشغيل الـWorkloads وتحديثها ومتابعة حالتها.

    Manual Recovery

    اكتشاف الأعطال والتدخل لاستعادة الحالة المطلوبة.

    Manual Scaling

    تعديل عدد الـInstances والتأكد من توافر الموارد اللازمة.

    Manual Networking

    إدارة الوصول إلى الـServices والـEndpoints والاتصال بين الـWorkloads.

    Kubernetes بيساعد في تحويل جزء كبير من المهام دي إلى عمليات Declarative وAutomated.

    flowchart TD
        COMPLEXITY(["Growing Operational Complexity"])
    
        COMPLEXITY --> DEPLOY(["Deployment"])
        COMPLEXITY --> SCALE(["Scaling"])
        COMPLEXITY --> RECOVER(["Recovery"])
        COMPLEXITY --> NETWORK(["Networking"])
        COMPLEXITY --> UPDATE(["Updates"])
    
        DEPLOY --> K8S(["Kubernetes Orchestration"])
        SCALE --> K8S
        RECOVER --> K8S
        NETWORK --> K8S
        UPDATE --> K8S
    
        K8S --> RESULT(["More Consistent Workload Management"])
    
        classDef problem fill:#f5efe6,stroke:#b08b62,stroke-width:2px,color:#3d3329;
        classDef task fill:#f5efe6,stroke:#b08b62,stroke-width:2px,color:#3d3329;
        classDef k8s fill:#f3eef4,stroke:#9a7fa0,stroke-width:2px,color:#3e3342;
    
        class COMPLEXITY problem;
        class DEPLOY,SCALE,RECOVER,NETWORK,UPDATE task;
        class K8S,RESULT k8s;

    المهم إن Kubernetes مش بيلغي الـOperations؛ هو بيغير طريقة تنفيذ جزء كبير منها.

    بدل ما نعتمد بالكامل على Manual Procedures، بنستخدم APIs وConfigurations وControllers وآليات Automation.

    11. Why Not Just Use Docker?

    سؤال مهم: لو Docker بيشغّل Containers، ليه أحتاج Kubernetes؟

    الإجابة إن الأدوات دي بتتعامل مع مستويات مختلفة من إدارة الـApplications.

    I. Container Tools

    أدوات زي Docker بتوفر إمكانيات لبناء Images وتشغيل Containers وإدارتها، وكمان إمكانيات Networking وStorage وغيرها.

    flowchart TD
        IMAGE(["Container Image"])
        IMAGE --> RUN(["Create and Run Container"])
        RUN --> MANAGE(["Manage Container Lifecycle"])
    
        classDef image fill:#f1eee8,stroke:#9b8f7e,stroke-width:2px,color:#3d3933;
        classDef process fill:#f5efe6,stroke:#b08b62,stroke-width:2px,color:#3d3329;
    
        class IMAGE image;
        class RUN,MANAGE process;

    II. Kubernetes

    Kubernetes بيشتغل على مستوى أعلى، وبيوفر إدارة للـWorkloads عبر Cluster من الـNodes.

    flowchart TD
        CONFIG(["Desired Workload Configuration"])
    
        CONFIG --> K8S(["Kubernetes"])
        K8S --> SCHEDULING(["Scheduling"])
        K8S --> RECON(["Reconciliation"])
        K8S --> NETWORK(["Service Networking"])
        K8S --> UPDATE(["Workload Updates"])
    
        classDef config fill:#f1eee8,stroke:#9b8f7e,stroke-width:2px,color:#3d3933;
        classDef k8s fill:#f3eef4,stroke:#9a7fa0,stroke-width:2px,color:#3e3342;
        classDef process fill:#f5efe6,stroke:#b08b62,stroke-width:2px,color:#3d3329;
    
        class CONFIG config;
        class K8S k8s;
        class SCHEDULING,RECON,NETWORK,UPDATE process;

    في Cluster Kubernetes المعتاد، الـkubelet بيتكامل مع Container Runtime متوافق من خلال CRI لتشغيل الـContainers الخاصة بالـPods.

    لكن Docker Engine نفسه مش هو الـRuntime اللي Kubernetes بيتواصل معاه مباشرة بالطريقة المعتادة حاليًا؛ لو محتاج تستخدم Docker Engine كـRuntime، فده ممكن يتم من خلال cri-dockerd.

    12. When Does Kubernetes Become Useful?

    Kubernetes مش الاختيار المناسب لكل Application.

    لو عندك Application صغيرة، بتشتغل على Server واحدة، وعدد الـContainers قليل، ممكن تكون إدارة الـContainers باستخدام Docker Compose أبسط وأسهل في الصيانة.

    flowchart TD
        APP(["Small Application"])
        APP --> SERVER(["Single Server"])
        SERVER --> CONTAINERS(["Few Containers"])
    
        classDef app fill:#eef3f1,stroke:#78968c,stroke-width:2px,color:#2f403a;
        classDef infra fill:#f1eee8,stroke:#9b8f7e,stroke-width:2px,color:#3d3933;
    
        class APP app;
        class SERVER,CONTAINERS infra;

    لكن Kubernetes بيكون أكثر فائدة لما يكون عندك احتياج حقيقي لإدارة الـWorkloads على نطاق أكبر، خصوصًا لما تحتاج:

    • Multiple Nodes and Workloads
    • Declarative Deployment Management
    • Advanced Scheduling
    • Automated Recovery
    • Horizontal Scaling
    • Service Discovery
    • Rolling Updates
    • Resource Requests and Limits
    • Standardized Operations Across Environments

    الفكرة الأساسية:

    Kubernetes becomes valuable when its orchestration capabilities justify the operational complexity of running the platform.

    13. Core Benefits at a Glance

    Operational Challenge How Kubernetes Helps
    Repetitive deployments Declarative Workload Management
    Changing workload demand Scaling Mechanisms and Autoscalers
    Failed Pods Controller Reconciliation and Recovery
    Multiple Nodes Scheduling
    Service communication Services and Cluster Networking
    Application updates Rolling Updates
    Resource allocation CPU and Memory Requests and Limits
    Configuration management ConfigMaps and Secrets
    Operational consistency APIs, Controllers, and Automation

    لاحظ إن العمود التاني بيوضح الآليات اللي Kubernetes بيوفرها، مش ضمان إن كل مشكلة هتتحل تلقائيًا من غير Configuration أو تدخل تشغيلي.

    14. The Main Mental Model

    لما تسأل نفسك:

    Why Kubernetes?

    مش المطلوب إنك تحفظ قائمة Features، لكن إنك تفهم المشكلة اللي الـPlatform بتحاول تحلها.

    flowchart TD
        APP(["Containerized Applications"])
        GROW(["Environment Grows"])
        COMPLEX(["Operational Complexity"])
    
        APP --> GROW
        GROW --> COMPLEX
    
        COMPLEX --> SCALE(["Scaling Challenges"])
        COMPLEX --> FAIL(["Workload Failures"])
        COMPLEX --> NETWORK(["Networking Challenges"])
        COMPLEX --> UPDATE(["Deployment Challenges"])
    
        SCALE --> K8S(["Kubernetes"])
        FAIL --> K8S
        NETWORK --> K8S
        UPDATE --> K8S
    
        K8S --> RESULT(["Automated Workload Orchestration"])
    
        classDef app fill:#eef3f1,stroke:#78968c,stroke-width:2px,color:#2f403a;
        classDef problem fill:#f5efe6,stroke:#b08b62,stroke-width:2px,color:#3d3329;
        classDef k8s fill:#f3eef4,stroke:#9a7fa0,stroke-width:2px,color:#3e3342;
    
        class APP,GROW app;
        class COMPLEX,SCALE,FAIL,NETWORK,UPDATE problem;
        class K8S,RESULT k8s;

    كل ما الـSystem يكبر، بيزيد عدد الـOperational Concerns اللي محتاجين نديرها.

    Kubernetes بيوفر Platform موحدة لإدارة الـWorkloads، وبيساعدنا نحول جزء كبير من العمليات المتكررة إلى Declarative Workflows.

    15. Final Summary

    Why Kubernetes?

    Why Kubernetes?

    لأن تشغيل الـContainers لوحده مش كفاية لما الـApplication والـInfrastructure يكبروا.

    Kubernetes بيوفر آليات لإدارة:

    • Deployment
    • Scheduling
    • Scaling
    • Networking
    • Recovery
    • Rolling Updates
    • Resource Management

    وبدل ما نعتمد بالكامل على إجراءات يدوية، بنحدد الـDesired State، والـControllers بتحاول تحافظ على الحالة المطلوبة من خلال الـReconciliation Loop.

    flowchart TD
        MANUAL(["Manual Container Management"])
        COMPLEX(["Growing Operational Complexity"])
        K8S(["Kubernetes Orchestration"])
        RESULT(["More Consistent Workload Management"])
    
        MANUAL --> COMPLEX
        COMPLEX --> K8S
        K8S --> RESULT
    
        classDef manual fill:#f5efe6,stroke:#b08b62,stroke-width:2px,color:#3d3329;
        classDef problem fill:#f5efe6,stroke:#b08b62,stroke-width:2px,color:#3d3329;
        classDef k8s fill:#f3eef4,stroke:#9a7fa0,stroke-width:2px,color:#3e3342;
    
        class MANUAL manual;
        class COMPLEX problem;
        class K8S,RESULT k8s;

    Kubernetes helps turn container management into a declarative orchestration system that can manage workloads across a cluster of machines.

    وده السبب الأساسي لاستخدام Kubernetes: مش مجرد تشغيل Containers، لكن تنظيم وإدارة الـWorkloads بصورة أكثر اتساقًا مع زيادة حجم الـSystem وتعقيده.

    Was this helpful?

    No

    Thanks for the feedback.

    Offline · Reading cached copy