Kubernetes Tutorial 0/90 lessons ~6 min read Lesson 3

    Kubernetes Architecture

    kubernetes architecture kubernetes architecture is a practical kubernetes capability, not just a definition to memorize. this lesson explains the problem it solves,

    Course progress0%
    Focus
    14 guided sections
    Practice signal
    Examples included
    Career prep
    Interview Q&A included

    Introduction

    Kubernetes Architecture is a practical Kubernetes capability, not just a definition to memorize. This lesson explains the problem it solves, why teams use it in production, how it behaves under failure, and how to practice it hands-on.

    Purpose of this lesson

    By the end, you should be able to decide when Kubernetes Architecture belongs in a design, implement it with a clear manifest or command flow, and troubleshoot the most common failure modes using Kubernetes status, events, logs, metrics, and ownership relationships.

    Understanding the topic

    A cluster has a control plane (API server, scheduler, controller manager, etcd) and worker nodes (kubelet, kube-proxy, container runtime). Everything talks through the API server.

    Architecture knowledge becomes essential when a rollout stalls, a pod is Pending, a webhook blocks deployment, or API latency affects the entire platform. You do not need to operate etcd every day, but you do need to know which component owns each decision.

    • Read every object through metadata, spec, and status: who owns it, what should happen, and what the cluster reports actually happened.
    • Connect YAML to the responsible component: scheduler, kubelet, controller manager, cloud controller, CSI driver, CNI, CoreDNS, admission webhook, or application runtime.
    • Use it only when it improves a real operating concern such as availability, rollout safety, service discovery, isolation, security, cost, or developer workflow.

    Visual explanation

    Use this mental model when explaining the lesson during design reviews or incidents:

    text
    kubectl / controller / GitOps
    -> kube-apiserver
    -> authn, authz, admission
    -> etcd
    -> scheduler chooses nodes
    -> kubelet starts pods
    -> controllers update status

    Step-by-step explanation

    1. Identify the workload or platform problem first: availability, traffic routing, storage, configuration, identity, policy, scaling, observability, or troubleshooting.
    2. Write the smallest useful desired state for Kubernetes Architecture; include labels, namespace, ownership, resource settings, and health checks where relevant.
    3. Apply or render the change in a safe environment, then read status and events before assuming the manifest worked.
    4. Break one realistic dependency such as a selector, image tag, probe, permission, quota, or endpoint and practice the recovery path.
    5. Promote through Git or your release process with a rollback plan, alert coverage, and a short runbook.

    Informative example

    The core architecture at a glance: After applying it, verify both desired and observed state. A production-ready workflow should include kubectl diff, apply, describe, get events, and a rollout or health check when the object supports it.

    yaml
    User / CI
    |
    v
    kube-apiserver -> etcd
    | |
    | +-> controller-manager reconciles desired state
    +-> scheduler chooses nodes
    |
    v
    worker node: kubelet -> container runtime -> pods

    Real-world use

    During an incident, new pods are created but never run. Architecture thinking separates API persistence, scheduler placement, kubelet startup, image pull, CNI networking, and readiness so the team can identify the exact failing hop.

    Best practices

    • Keep manifests reviewed in Git and treat manual cluster changes as temporary break-glass actions.
    • Use standard labels such as app.kubernetes.io/name, part-of, and managed-by so selectors, dashboards, alerts, and cost reports line up.
    • Attach ownership, environment, and runbook metadata before resources reach production.

    Common mistakes

    • Confusing resource exists with resource is healthy. Always inspect status, events, and downstream dependencies.
    • Changing selectors, labels, or names casually; these are contracts between controllers, Services, policies, dashboards, and GitOps tools.
    • Debugging from memory instead of reading the object: kubectl describe, events, endpoints, and controller logs usually tell the story.

    Debugging tips

    • If objects cannot be created, inspect API server admission, RBAC, validating webhooks, and quota.
    • If objects exist but pods do not run, move to scheduler events, node conditions, kubelet logs, and runtime status.
    • If status is stale, suspect controller health or watch/API connectivity rather than the manifest alone.

    Optimization strategies

    • Tune requests, limits, probes, and rollout settings from observed production behavior instead of copying defaults.
    • Reduce blast radius with namespaces, quotas, PodDisruptionBudgets, topology spread, and progressive delivery.
    • Automate validation with CI, policy checks, and GitOps drift detection so correctness is enforced before outages.

    Advanced interview questions

    Interview Prep

    Practice concise answers, then expand each card for the explanation.

    2 questions
    1QuestionHow should you explain <strong>Kubernetes Architecture</strong> in a senior Kubernetes discussion?+

    Answer

    Walk through what happens after kubectl apply: validation, admission, etcd persistence, controller watches, scheduling, kubelet execution, and status updates.
    2QuestionWhat separates a lab answer from a production-ready answer?+

    Answer

    A production-ready answer includes ownership, rollout behavior, failure modes, observability, security boundaries, and a rollback or mitigation path.

    Hands-on exercise

    Apply a Deployment, then trace it through kubectl get deploy,rs,pod, kubectl describe pod, and node events. Name which component changed each piece of state.

    bash
    # Suggested lab loop for Kubernetes Architecture
    kubectl create namespace kubernetes-architecture-lab
    kubectl -n kubernetes-architecture-lab apply -f lesson.yaml
    kubectl -n kubernetes-architecture-lab get all
    kubectl -n kubernetes-architecture-lab describe all
    kubectl -n kubernetes-architecture-lab get events --sort-by=.lastTimestamp

    Summary

    Kubernetes Architecture becomes valuable when you connect the API object or command to real operational behavior. Practice the happy path, then deliberately break it so troubleshooting becomes evidence-driven rather than guesswork.

    Ready to mark this lesson complete?Track your journey across the entire course.