Kubernetes — Core Architecture Explained

Stalin Rijal
3 min readAug 7, 2023

--

What is Kubernetes ?

  • At its core, K8s is a container orchestrator. It’s job is to start and stop container based application.
  • Its key facets is workload placement. It provides infrastructure abstraction and manages resource and load balancing with ease microservice (pods) management.
  • It maintains the desired state configuration.

Kubernetes Architecture:

Kubernetes Broder View:

Kubernetes Master and Worker Nodes:

Benefits:

- Speed of deployment.

- Absorbs Change quickly

- Ability to recover quickly

- Hide complexity of cluster

Kubernetes API:
- Its the API server where we , developer work in k8s. It is the only way to interact with the cluster by k8s as well.
- It is RESTful API that runs over http/s using JSON.
- Different configuration states are serialized and persisted into cluster data store. (when changed or updated)

Kubernetes API Objects:
Some of the key API objects in K8s cluster:

1. Pods:
- They are the building block of containerized application.
- The are single or collection of containers that we deploy as a single unit.
- They are emphemeral . No pod pod is ever redeployed.

2. Controllers:
- These are the things that keep our system in desired state.
- Manages pods and respond to pod state and health.
- Manages Replica set, deployment, etc.

3. Services:
- While Pods, Controllers are consistently changing, Services are responsible for providing persistent access point to the applications.
- Networking Abstraction for pods.
- IP and DNS name for service.
- Load balancing

4. Storage:
- Persistent volume (Pod independent storage that is defined in cluster level)
- Pods can access volume using “persistent volume claim”.

Key Topics:

Control Plane (Master):
- It controls the cluster and make it function.
- Manages Cluster operations, monitoring, pod scheduling

The following are the Control-Plane(Master Node) Components:

  1. Etcd:
    - persistently stores cluster configuration(key-value data).

2. Scheduler:
- Schedules apps. (Assigns pods to nodes as per resource requirement and availability)

3. Controller Manager:
- Perform cluster-level functions. (Eg. replicating components, keeping track of worker nodes, handling node failure, etc.)

4. API Server:
- To which user, worker nodes and other control plane components communicate with.

Worker Nodes:
- It’s where the containerized app runs.
- These three Kublet,Kube-Proxy and Container-runtime services will exists in all nodes including the control plane.

The following are the Worker Node components:

  1. Kube-Proxy:
    - Networking proxy that enables pod-to-pod, pod-to-service communication.
    - It also acts as load balancer.

2. Kubelet:
- Ensures pod specs are running and healthy.

3. Container Runtime:
- Runtime environment for containers.

4. Plugins for DNS, Dashboard, Cluster Monitoring and Cluster Logging:

Hitting moving target:

Kubernetes may need to move our pods around the cluster on node failure or k8s may move the pod for making efficient use of the resource.

Moving the target wont cause an issue as multiple containers of same service are grouped under same static IP address. As, IP address of the container stays constant , connection always stay reachable to their containers even when they moved around cluster.

Kubernetes Networking Rules:

  • Pod on a node can communicate with all pods on all nodes on the cluster without Network Address Translation(NAT).
  • Agents (daemons, Kubelet, etc.) running on the node can communicate with all pods on that node.

--

--

Stalin Rijal
Stalin Rijal

Written by Stalin Rijal

SRE || CLOUD || DEVOPS ENGINEER

No responses yet