Module 12 Lesson 4: Introduction to Kubernetes
·DevOps

Module 12 Lesson 4: Introduction to Kubernetes

Meet the industry standard. Discover the architecture of Kubernetes, the difference between Pods and Containers, and why it is the OS of the modern cloud.

Module 12 Lesson 4: Introduction to Kubernetes (K8s)

Kubernetes (often called K8s—because there are 8 letters between K and s) is the most powerful container orchestrator in the world. Originally built by Google, it is now the standard for every major cloud provider (AWS, Google, Microsoft).

1. What makes Kubernetes Different?

If Docker is a Single Car, and Swarm is a Bus Fleet, then Kubernetes is a NASA Mission Control Center. It can handle thousands of machines, multiple data centers, and extremely complex networking rules.


2. Core Architecture

The Control Plane (The Brains)

  • API Server: The gateway for all commands.
  • etcd: The database that stores the state of the whole cluster.
  • Scheduler: Decides which node should run which workload.

The Nodes (The Workers)

  • Kubelet: The "Agent" that runs on every server to ensure containers are running.
  • Kube-Proxy: Manages the networking and load balancing.

Visualizing the Process

graph TD
    Start[Input] --> Process[Processing]
    Process --> Decision{Check}
    Decision -->|Success| End[Complete]
    Decision -->|Retry| Process

3. The Central Concept: The POD

In Docker, the smallest unit is a Container. In Kubernetes, the smallest unit is a Pod.

  • A Pod can hold one or more containers that share the same IP address and storage.
  • Analogy: Imagine a "Sidecar" pattern where you have your App Container and a Logger Container in the same Pod, sharing the same space.

4. Key Objects

  • Deployment: Manages a set of identical Pods (Scaling, Updates).
  • Service: Provides a permanent IP address for a set of Pods (Load Balancing).
  • Ingress: The "Front Door" that routes internet traffic to your Services.

5. Why is it hard?

Kubernetes uses a very verbose YAML format. A simple Nginx app that takes 10 lines in Docker Compose can take 100 lines of Kubernetes configuration. For this reason, many teams start with Swarm and only "Graduate" to K8s when they truly need its massive power.


Exercise: The Terminology Match

  1. In Docker, we have an Image. What is it in Kubernetes? (Answer: Still an image!).
  2. In Swarm, we have a Service. What is the equivalent in K8s? (Answer: Deployment).
  3. In Swarm, we have the Routing Mesh. What is the equivalent in K8s? (Answer: Service and Ingress).
  4. Research: What is Minikube? Why would a developer use it on their laptop?
  5. Why is "High Availability" easier to achieve in Kubernetes than in plain Docker?

Summary

Kubernetes is the "Operating System" of the cloud. While it has a steep learning curve, mastering its basics (Pods, Deployments, and Services) is the single most valuable skill a modern DevOps engineer can have.

Next Lesson: Making the choice: Choosing between Swarm and Kubernetes.

Subscribe to our newsletter

Get the latest posts delivered right to your inbox.

Subscribe on LinkedIn