Skip to main content

MODULE 1 - Introduction to Kubernetes

Overview

This first module introduces you to Kubernetes, the world's most widely used container orchestration platform. You will discover why Kubernetes exists, how it works at a high level, and what the fundamental concepts are that you will use throughout this course.

Learning Objectives

By the end of this module, you will be able to:

  • Explain what Kubernetes is and why it is essential
  • Understand the evolution from containerization to orchestration
  • Identify the main components of a Kubernetes cluster
  • Distinguish the Control Plane from Worker Nodes
  • Use kubectl to interact with a cluster
  • Start a local cluster for practice

Estimated Duration

Theory: 3-4 hours
Practice: 2-3 hours
Total: 5-7 hours


Table of Contents

Part 1: Introduction and Concepts

  1. Chapter 1.1 - What is Kubernetes?
  2. Chapter 1.2 - Why Kubernetes?
  3. Chapter 1.3 - History and Evolution
  4. Chapter 1.4 - High-Level Architecture
  5. Chapter 1.5 - Fundamental Concepts

Part 2: Installation and Practice

  1. Chapter 1.6 - Installation and Configuration

Hands-on Labs

Validation


What is Kubernetes?

Kubernetes (often abbreviated as K8s) is an open-source container orchestration platform that automates the deployment, scaling, and management of containerized applications.

Simple Definition

Imagine you have multiple applications (microservices) that need to:

  • Run on multiple servers
  • Be automatically restarted if they crash
  • Be scaled according to load
  • Communicate with each other reliably

Kubernetes does all of this automatically for you.

Analogy: The Orchestra Conductor

Just as a conductor coordinates musicians, Kubernetes coordinates your containers so they work together harmoniously.

Key Features

Kubernetes provides:

  1. Automatic Orchestration

    • Automatic deployment and restart
    • Distribution of containers across available machines
    • Application lifecycle management
  2. Scaling

    • Automatic increase/decrease of instance count
    • Adaptation to workload
    • Resource utilization optimization
  3. Self-Healing

    • Automatic restart of crashing containers
    • Replacement of failing containers
    • Redistribution in case of machine failure
  4. Service Discovery

    • Automatic communication between services
    • Built-in load balancing
    • Internal DNS management
  5. Configuration Management

    • Centralized configuration storage
    • Secure secrets management
    • Declarative deployments

Why Kubernetes?

Challenges Without Kubernetes

Before Kubernetes, deploying containerized applications was complex:

Problems:

  • Manual container management
  • No automatic restart
  • Complex and manual scaling
  • No built-in load balancing
  • Scattered configuration management
  • No service discovery

Advantages With Kubernetes

Advantages:

  • Complete automatic orchestration
  • Self-healing and high availability
  • Horizontal and vertical scaling
  • Built-in load balancing
  • Automatic service discovery
  • Centralized configuration management

Typical Use Cases

Kubernetes is ideal for:

  1. Microservices

    • Applications composed of many small services
    • Inter-service communication
    • Independent deployment of each service
  2. Cloud-Native Applications

    • Applications designed for the cloud
    • Automatic scalability
    • Resilience and self-healing
  3. DevOps and CI/CD

    • Automated deployments
    • Easy rollback in case of issues
    • Multiple environments (dev, staging, prod)
  4. Multi-cloud and Hybrid Cloud

    • Deployment across multiple clouds
    • Portability between environments
    • Avoid vendor lock-in

History and Evolution

The Evolution of Containerization

Google and Borg

Kubernetes was created by Google, which internally used a system called Borg to orchestrate millions of containers.

Borg (2003-2015):

  • Google's proprietary system
  • Managed hundreds of thousands of jobs
  • Foundation of experience for Kubernetes

Kubernetes (2014):

  • Open-source version inspired by Borg
  • Named after the Greek word "kuberntes" (pilot, helmsman)
  • K8s = K + 8 letters + s

Adoption and Growth

Key figures:

  • Used by millions of organizations
  • Over 100,000 GitHub commits
  • Over 3,000 contributors
  • Adopted by all major tech companies

High-Level Architecture

Cluster Overview

A Kubernetes cluster is composed of two types of machines:

Control Plane (Master)

The Control Plane is the "brain" of the cluster. It makes all decisions and manages the cluster state.

Control Plane Components:

  1. API Server

    • Single entry point for all interactions
    • Validates and processes requests
    • Exposes the Kubernetes REST API
  2. etcd

    • Distributed database
    • Stores the cluster state
    • Single source of truth
  3. Controller Manager

    • Runs the control loops
    • Monitors desired state vs actual state
    • Takes corrective actions
  4. Scheduler

    • Decides on which node to place new pods
    • Takes into account resources and constraints
    • Optimizes distribution

Worker Nodes

Worker Nodes run the applications. Each node contains:

Worker Node Components:

  1. kubelet

    • Agent that communicates with the API Server
    • Manages pods on the node
    • Monitors container health
  2. kube-proxy

    • Manages networking at the node level
    • Implements Services (load balancing)
    • Manages network rules
  3. Container Runtime

    • Runs containers (Docker, containerd, CRI-O)
    • Manages images and containers
    • Standardized interface (CRI)

Fundamental Concepts

Pods

A Pod is the smallest deployable unit in Kubernetes. It is a group of one or more containers that share resources.

Characteristics:

  • One Pod = one or more containers
  • Containers in a Pod share:
    • IP address
    • Volumes
    • Network namespace
  • Pods are ephemeral (can be recreated)

Deployments

A Deployment describes the desired state of your application (how many replicas, which image, etc.).

Features:

  • Replica management (number of instances)
  • Rolling updates (updates without interruption)
  • Rollback in case of issues
  • Self-healing

Services

A Service exposes a set of Pods as a stable network service.

Service Types:

  • ClusterIP: Internal service within the cluster
  • NodePort: Exposed on a port of each node
  • LoadBalancer: Exposed via a cloud load balancer
  • ExternalName: Alias to an external service

Namespaces

Namespaces allow you to divide a cluster into multiple virtual environments.

Advantages:

  • Logical isolation
  • Environment separation
  • Resource quota management
  • Access control (RBAC)

Kubernetes Ecosystem

Kubernetes is not alone. It is part of a rich ecosystem of tools and projects.

CNCF Projects

The Cloud Native Computing Foundation (CNCF) hosts many Kubernetes-related projects:

  • Kubernetes: Orchestration
  • Prometheus: Monitoring
  • Helm: Package management
  • Istio: Service mesh
  • Fluentd: Logging
  • etcd: Distributed storage
  • And many more...

Module Summary

In this module, you learned:

Kubernetes is a container orchestration platform
It automates deployment, scaling, and application management
A cluster is composed of a Control Plane and Worker Nodes
Pods are the smallest deployable unit
Deployments manage the application lifecycle
Services expose applications in a stable manner
Namespaces enable logical isolation


Next Steps

Now that you understand the basic concepts, you are ready for:

Module 2: Detailed architecture and Kubernetes components
Module 3: Pods and Deployments in practice


Additional Resources


Module created: December 2024