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

    What is Kubernetes?

    what is kubernetes? what is kubernetes? is a practical kubernetes capability, not just a definition to memorize. this lesson explains the problem

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

    Introduction

    What is Kubernetes? 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 What is Kubernetes? 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

    Kubernetes orchestrates containers across many machines. It schedules workloads, restarts failed pods, exposes services, mounts storage, and gives teams a consistent deployment API.

    Use Kubernetes when you need a consistent deployment and operations layer for many services, teams, or environments. A single low-traffic app may not justify the platform cost, but a growing estate benefits from standard scheduling, recovery, networking, rollout, and policy APIs.

    • 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
    Developer commits code
    -> CI builds immutable image
    -> Kubernetes objects declare desired state
    -> controllers reconcile pods, Services, storage, and policy
    -> observability proves whether users are healthy

    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 What is Kubernetes?; 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

    Create a deployment and expose it: 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.

    bash
    kubectl create deployment web --image=nginx:1.27-alpine
    kubectl scale deployment web --replicas=3
    kubectl expose deployment web --port=80 --type=ClusterIP
    kubectl get deploy,rs,pods,svc

    Real-world use

    A SaaS company moving from hand-managed VMs uses Kubernetes to make every service deploy the same way: build an image, apply manifests, wait for rollout health, and roll back through the Deployment controller instead of logging into servers.

    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

    • Start with kubectl describe and recent events sorted by time; they often identify scheduling, image, probe, volume, or policy failures.
    • Compare desired state with live state using kubectl get -o yaml, kubectl diff, and the owning controller's status.
    • Follow the traffic or lifecycle path one hop at a time rather than jumping straight to the node or the application code.

    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>What is Kubernetes?</strong> in a senior Kubernetes discussion?+

    Answer

    Explain Kubernetes as a declarative control plane for containers. Emphasize controllers, desired state, scheduling, service discovery, and recovery rather than describing it as simply a container runner.
    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

    Create a Deployment, expose it with a Service, delete one pod manually, and watch the ReplicaSet recreate it. That small exercise demonstrates the central Kubernetes promise: reconciliation.

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

    Summary

    What is Kubernetes? 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.