60DaysOfK8s – Day 1 VM vs Container, K8s architecture

K8s is a technology that I want to learn for a long time. Now I finally start learning it systematically. To better measure the goal, I scheduled a CKA exam 60 days after to test knowledge and skill. This series will record my journey on K8S from zero to hero (lol). I base my learning on the official documentation. https://kubernetes.io/docs/

This graph speaks a lot. The benefits of using container are obvious. Like VM, containers can run different apps of different dependencies simultaneously. But container is lightweight compared to VM as it can share OS among apps. Check this https://www.youtube.com/watch?v=el7768BNUPw. Now container is an ideal choice for microservices, CI/CD, distributed systems, etc.

Who is going to monitor the health of container and restart it when it’s down? Who will allocate storage resources? Who will store secret and configuration of containers? K8s is born to tackle these issues.

In one word, k8s is an open-source container orchestration tool.

Components of Kubernetes
cluster architecture

Control Plane/ Master

etcd is key-value store for k8s as it’s simple, secure and fast. This video explains the Raft consensus algorithm(ensure data store consistency) very clearly.

https://www.ibm.com/cloud/learn/etcd#toc-what-is-et-3zfnOioH

Scheduler watches for newly created Pods with no assigned node, and selects a node for them to run on.

Controller is a control loop that regulates the state of a system. A good analogy is Air Con, which can heat up or cool off the air to the set temperature. Controller tracks at least one Kubernetes resource type. There are Node controller, Job controller, Endpoints controller, Service Account & Token controllers. controller-manager manages controllers.

cloud-controller-manager is for cloud-specific controllers, one of which is route controller.

Node

Node overview

A Node is a worker machine and may be either virtual or physical.

A Pod represents a group of one or more application containers, and some shared resources for those containers. It is the smallest deployable units of computing that you can create and manage in Kubernetes.

kubelet is an agent that runs on each node handling the communication between the control plane and nodes.

kube-proxy maintains network rules on nodes.

The container runtime is the software that is responsible for running containers. A typical example is Docker.

Leave a comment