Kubernetes Core Concepts
Kubernetes Core Concepts
π― Objective
By the end of this lesson, you will:
- Understand the essential components that make up a Kubernetes system
- Learn how these components work together
- Be able to identify the role of each core object in a typical Kubernetes setup
π§± Kubernetes Cluster
A Kubernetes Cluster is a set of machines that work together to run containerized applications. It consists of:
- Master Node (Control Plane) β Manages the cluster
- Worker Nodes β Where the actual applications run
π₯οΈ Node
A Node is a single machine (VM or physical) in the cluster. Each node runs:
kubelet
: Talks to the control planekube-proxy
: Handles networking- Container runtime (e.g., Docker or containerd)
There are two types:
- Master Node: Controls and manages the cluster
- Worker Node: Executes workloads (containers inside Pods)
π¦ Pod
A Pod is the smallest deployable unit in Kubernetes. It can hold:
- One or more containers
- Shared storage
- Network resources
Note: If you deploy a single container, it’s still wrapped inside a Pod.
π ReplicaSet
A ReplicaSet ensures a specified number of pod replicas are running at any given time. If a pod fails, it automatically creates a new one to replace it.
π Deployment
A Deployment manages ReplicaSets and allows:
- Easy updates and rollbacks
- Scaling up/down
- Ensuring desired state is met
You define it in a YAML file, and Kubernetes does the rest.
π Service
A Service provides a stable way to access your pods. Since pods have dynamic IPs, services allow consistent communication.
Types:
- ClusterIP β Internal communication
- NodePort β Accessible from outside on a static port
- LoadBalancer β Used in cloud environments for public access
π§ Ingress
An Ingress is an API object that manages external access to services, typically HTTP/HTTPS. It acts as a smart router for incoming traffic.
π Example Scenario
Letβs say you want to run a website:
- You create a Deployment for your app (3 replicas)
- It runs inside Pods
- A ReplicaSet ensures all 3 are always running
- A Service exposes them
- An optional Ingress routes web traffic to the Service