2 min to read
Understanding Kubernetes Components and Pod Creation
A comprehensive guide to Kubernetes architecture and its core components
🎯 Overview
Let’s explore Kubernetes components and understand how pods are created within a cluster.
💡 Why Kubernetes?
Kubernetes offers several key benefits:
- 🔄 Container Orchestration
- 📈 Scalability
- ⚖️ Load Balancing
- 🔨 High Availability
- 🚀 Automated Rollouts and Rollbacks
- 🔍 Service Discovery
- 💾 Storage Orchestration
- 🔐 Secret and Configuration Management
🏗️ Kubernetes Components
Control Plane Components
1. kube-apiserver
- Central control point
- Provides Kubernetes API
- Handles Pod creation requests
2. etcd
- Backup storage for cluster data
- Maintains cluster state
- Stores configuration and status
3. kube-scheduler
- Watches for new Pods
- Assigns Pods to nodes
- Considers resource requirements
4. kube-controller-manager
- Runs controller processes
- Maintains desired state
- Handles routine tasks
Node Components
1. kubelet
- Ensures container operation
- Manages Pod lifecycle
- Communicates with control plane
2. kube-proxy
- Manages network rules
- Enables Pod communication
- Maintains network policies
3. Container Runtime
- Runs containers
- Supports various runtimes
- Manages container lifecycle
🔄 Pod Creation Process
User initiates deployment
kubectl apply -f k8s-deployment.yml
Process Flow
sequenceDiagram
participant Client
participant API_Server as API Server
participant etcd
participant Controller_Manager as Controller Manager
participant Scheduler
participant Kubelet
participant Container_Runtime as Container Runtime Interface
Client->>API_Server: 1. Create Pod
API_Server->>etcd: 2. Store object definition
etcd-->>API_Server: (Acknowledge)
API_Server->>etcd: 3. Create POD resources & update etcd
etcd-->>API_Server: (Acknowledge)
API_Server->>Controller_Manager: 4. Identify where POD has to be created & update the state in etcd
Controller_Manager-->>API_Server: (Acknowledge)
Controller_Manager->>Scheduler: 5. Retrieve the template for the POD
Scheduler->>Kubelet: 6. Create the container
Kubelet->>Container_Runtime: (Container Created)
Controller_Manager->>etcd: 7. Update the state
📌 Explanation of the Mermaid Diagram
- Client → API Server: Initiates the Pod creation request.
- API Server → etcd: Stores the object definition.
- API Server → etcd: Updates etcd with POD resource information.
- API Server → Controller Manager: Determines where to create the Pod and updates the state.
- Controller Manager → Scheduler: Scheduler retrieves the template for Pod scheduling.
- Scheduler → Kubelet → Container Runtime: Kubelet commands the Container Runtime to create the container.
- Controller Manager → etcd: Updates the final state in etcd.
This flow closely mirrors the Kubernetes pod creation lifecycle.
Comments