Skip to main content

Cluster Architecture

Cluster Architecture

Kubernetes Basics

Architecture Components

Basic question, what is kubernetes cluster?
# My Answer
In my opinion kubernetes cluster can be specify as group or multiple pod that being hosted in multiple server. and is communicated by using certain method of networking level inside the server

# Proper Answer
A Kubernetes cluster is a set of node machines for running containerized applications. If you’re running Kubernetes, you’re running a cluster. At a minimum, a cluster contains a worker node and a master node.
Further forward, what is node exactly in kubernetes?
# My Answer
Node the smallest running machine or atomic level component inside each kubernetes cluster. this will be the foundation of the cluster itself

# Proper Answer
A node is a virtual or a physical machine that serves as a worker for running the applications. It's recommended to have at least 3 nodes in a production environment.
Now i already know the node inside kubernetes, so in node there is master or control plane node and worker nodes. what is the different of each of it?
# My Answer
Based on the definition, master node have bigger control of the cluster than the worker node. so the availability will depend on master-node and worker handling the sub-process

# Proper Answer
1. Master Nodes (Also called Control Plane Nodes):
1a. Purpose: These nodes manage the Kubernetes cluster as a whole. They make global decisions about scheduling, detecting and responding to cluster events, and running the core Kubernetes control plane components.
1b. Key Components:
a. API Server: The front-end to the Kubernetes control plane. It's how you (or other tools) interact with the cluster.
b. Scheduler: Decides which node to place new Pods (containers) on based on resource availability and constraints.
c. Controller Manager: Runs the controllers that handle various tasks, such as replicating Pods, maintaining the desired number of Pods, and reacting to node failures.
d. etcd: A distributed key-value store that stores the cluster's state and configuration data.

2. Worker Nodes (Also called Worker Machines)
1a. These are the workhorses of the cluster. They run your applications, packaged as Pods.
1b. Key Components:
a. Kubelet: An agent that runs on each node. It communicates with the master nodes, ensures containers are running in a Pod, and manages the node's resources.
b. Container Runtime: Software that allows Kubernetes to run containers. Popular examples include Docker, containerd, and CRI-O.
c. Kube-proxy: A network proxy that runs on each node and helps route traffic to the correct containers (Pods) within the cluster.
OK, now i already know what inside each of master nodes and worker nodes. but Architectural how they communicate?
# My Answer
No Clue

architecture

# Proper Explanation
Lets use this image as an explanation. first we can divide the component to control plane (on the left) and workers (on the right)

1. Control Plane
- This section represents the master nodes (often multiple for redundancy) responsible for managing the entire cluster. Notice the "x3" indicating three instances of some components this is common for high availability.
- Components:
- API Server: this is single entry point for all interaction with the kubernetes cluster, user, cli-tools and other components using this
- Scheduler: this have 3 instance to support HA. this will function to determine which worker node is best suited to run a new pod.
- ETCD: A distributed key-value store that holds the clusters configuration data, state information, and secrets.
- Controller Manager: this will run various controllers to ensure desire state of the cluster (managing deployments, replication pods, reacting to node failures)

2. Workers
- This section represents the worker nodes, which are the machines where your applications (containerized workloads) actually run.
- Components:
- Kubelet: an agent that runs on each worker node, receiving instructions from control plane and ensuring the pods running normally. this will manage the container lifecycles, mount storage , and report node status back to master node
- Kube-Proxy: a network proxy that runs on every worker node. this will handling network rules, service discovery and load balancing to ensure the communication between pods and services works seamlessly