Learning Container Platforms: Notes on Docker, Kubernetes, and Helm

Table of Contents


What Is a Container?

A container is a lightweight, standalone, and executable software unit that packages application code together with its dependencies, allowing the application component to run reliably across different environments.

Technically, a container is an isolated process running on a shared operating system kernel. Each application component—such as a frontend UI, a backend API service, or a database—can run in its own containerized environment, completely separated from the host system and other components.

Key characteristics of containers include:

  • Self-contained: Each container includes all necessary libraries, runtime, and configuration, removing the need for pre-installed dependencies on the host machine.
  • Isolated: Containers operate in isolation from one another and from the host, enhancing security and reducing the risk of conflicts between components.
  • Independent: Containers are individually managed and can be started, stopped, removed, or updated without impacting others.
  • Portable: A container built on one system can be deployed and executed consistently across development machines, data centers, or cloud platforms.

These properties make containers well-suited for building scalable, maintainable systems using microservices or distributed architectures.


What Is Docker?

Docker is an open-source platform designed for building, packaging, and running containerized applications. It allows applications to be decoupled from the underlying infrastructure, providing a consistent environment across development, testing, and production.

At its core, Docker provides tools to package application code along with all dependencies into containers—lightweight, isolated units that can run reliably on any system with Docker installed.

A typical workflow includes:

  1. Build the image using a Dockerfile.
  2. Run the image as a container.
  3. Test the application locally or in CI pipelines.
  4. Push the image to a registry.
  5. Deploy the container in production (standalone or using an orchestration tool like Kubernetes).

This container-based workflow improves reproducibility, scalability, and automation across all stages of the software lifecycle.


What Is Kubernetes?

Kubernetes (K8s) is an open-source container orchestration platform designed to automate the deployment, scaling, and management of containerized applications across a cluster of machines.

Kubernetes addresses the operational challenges of running multiple containers across different hosts. Instead of manually deploying, monitoring, and restarting containers, Kubernetes provides a higher-level abstraction for automating these tasks.

Kubernetes Core Components

Pod

A Pod is the smallest deployable unit in Kubernetes. Each Pod typically runs a single application component, such as a backend API or frontend service.

  • A Pod may contain one or more containers, though it’s common to use only one container per Pod.
  • All containers in the same Pod share the same network namespace and storage volumes.
  • Pods are defined using a YAML file that declares their desired configuration and state.

Worker Node

A Worker Node is a physical or virtual machine that runs containerized workloads. It is responsible for hosting Pods and providing the required computing resources.

Key components of the Worker Node:

  • kubelet: The agent that ensures containers are running as specified in the Pod definitions. It also reports node status to the control plane.
  • kube-proxy: Maintains network rules on the node, allowing services to be reached inside or outside the cluster.
  • Container Runtime: The software that actually runs containers, such as Docker Engine or containerd.

Master Node (Control Plane)

The Master Node is the central controller that manages the entire Kubernetes cluster. It handles scheduling, coordination, and overall cluster state.

Key components of the Master Node:

  • kube-apiserver: Acts as the entry point for all cluster operations. It handles communication with nodes and clients through the Kubernetes API.
  • etcd: A key-value store used for storing all cluster data, including configuration and state.
  • kube-controller-manager: Runs various background processes (controllers) that monitor and adjust the cluster state to match the desired configuration.
  • kube-scheduler: Assigns Pods to Worker Nodes based on resource availability and scheduling policies.

Cluster

A Cluster is a set of Master and Worker Nodes working together as a single unit. The cluster is the full runtime environment in which containerized applications are deployed, scaled, and managed.

Basic Workflow

  1. User Command
    • A user initiates the creation of a Pod using a command-line tool like kubectl.
    • For example: kubectl apply -f pod.yaml
  1. API Server
    • The command reaches the API Server, which serves as the entry point for all Kubernetes operations.
    • The API Server verifies the user’s identity (authentication and authorization).
    • Once validated, the request is stored in etcd, the cluster’s persistent storage.
  1. Controller Manager
    • The controller-manager monitors the cluster state through the API Server.
    • It detects the new Pod request and begins processing it based on the desired state.
    • If resources allow, the controller-manager prepares the Pod for scheduling.
  1. Scheduler
    • The kube-scheduler continuously watches for Pods that are not yet assigned to a Node.
    • It evaluates available Worker Nodes based on resource availability, constraints, and scheduling policies.
    • The scheduler selects the most suitable Node and assigns the Pod to it.
  1. Pod Launch
    • The chosen Worker Node is notified and starts the Pod using its container runtime (e.g., containerd or Docker).
    • The Pod is now running and becomes part of the cluster’s live workloads.

Advanced Kubernetes Components

Service

A Service in Kubernetes defines how a group of Pods can be accessed. When multiple Pods provide the same functionality (e.g., web servers or APIs), a Service ensures that traffic can be consistently routed to healthy instances.

Deployment

A Deployment manages the desired state of Pods by defining a template and a replica count. Kubernetes ensures that the correct number of Pods is running at all times, and it provides features like rolling updates and rollback.

Ingress

An Ingress manages external HTTP/HTTPS access to Services. Unlike NodePort or LoadBalancer, which expose each Service separately, Ingress provides a unified entry point to multiple Services using hostname or path-based routing.


What Is Helm?

Helm is a package manager for Kubernetes. It helps you manage complex applications by bundling related Kubernetes manifests (YAML files) into a single unit called a Chart. Helm makes it easier to install, upgrade, and delete applications in a consistent and repeatable way.

In short, Helm solves the problem of managing multiple Kubernetes resources as one logical group, especially when those resources share configuration and need to be deployed together.

What Is a Helm Chart?

A Helm Chart is a directory with a standard structure:

mychart/
├── Chart.yaml      # Chart metadata
├── values.yaml     # User-defined configuration values
└── templates/      # Templated Kubernetes YAML files
  • Chart.yaml: defines the chart name, version, and description
  • values.yaml: holds configurable parameters (e.g., image name, replicas)
  • templates/: contains Kubernetes resource templates (e.g., Deployment, Service)

Templates use placeholders to inject values from values.yaml, allowing for dynamic and reusable configurations.


References

What is a container?
What is a container? This concept page will teach you about containers and provide a quick hands-on where you will run your first container.
What is Docker?
Get an in-depth overview of the Docker platform including what it can be used for, the architecture it employs, and its underlying technology.
Production-Grade Container Orchestration
Kubernetes, also known as K8s, is an open source system for automating deployment, scaling, and management of containerized applications. It groups containers that make up an application into logical units for easy management and discovery. Kubernetes builds upon 15 years of experience of running production workloads at Google, combined with best-of-breed ideas and practices from the community. Planet Scale Designed on the same principles that allow Google to run billions of containers a week, Kubernetes can scale without increasing your operations team.
GitHub - HcwXd/kubernetes-tutorial: A hands-on tutorial for learning kubernetes (k8s), including examples of Deployment, Service, Ingress, Helm
A hands-on tutorial for learning kubernetes (k8s), including examples of Deployment, Service, Ingress, Helm - HcwXd/kubernetes-tutorial