Monday 18 April 2022

CKA Kubernetes ( K8S ) Cluster Architecture

 The preparation for the CKA (Certified Kubernetes Administrator) requires lots of practice and practice. Fortunately, we have lots of online playgrounds to keep practicing, there are lots of free courseware available and lots of paid as well are available. In addition to that, we get two attempts to clear the exam




Even though the CKA exam is a performance-based exam, we should know the concepts thoroughly so we can solve the problems for troubleshooting and fixing.

Types of K8S deployment

• Manual from scratch
○ All components will be installed directly in the master nodes as a linux service
• Using kubeadm command
○ All components of master will be running as a pod under kube-system namespace

Two types of Nodes

• Master Node 
○ ETCD Cluster - Stores information about the cluster
○ K8S Scheduler - Used to for deploying containers in worker nodes
○ Node Controller - 
○ Replication Controller
○ kube-apiserver - for orchestrating communication between services/containers within the cluster
• Worker Nodes
○ kubelet - is a agent runs on each worker node and listens for instruction from master node
○ kube-proxy - is used for communication between containers within worker node or across worker nodes

Containers

• Even the components running in the master node is also runs inside a container
• K8S supports multiple different container runtime engines
○ docker
○ containerd
○ rkt

ETCD

• Distributed reliable key-value store
• Open source and we need to bring up the service by executing the binary
• by default the service comes up in port 2379
• and comes with a default client called etcdctl

ETCD in K8S

• It stores all the details of the cluster like
○ Nodes
○ Pods
○ Configs
○ Secret
○ Accounts
○ Roles
○ Binding

kube-apiserver

• We can use following clients to talk to kube-apiserver
○ kubectl
○ REST APIs
• Eg: when we execute "kubectl get pods", the kube-apiserver receives the commands and checks the etcd cluster and responses
• The kube-apiserver is responsible for
○ Authenticating the user
○ Validating the request
○ Update the ETCD
○ Talks to scheduler, kubelet etc

Controller Manager : kube-controller-manager

• Node controller responsibility is to monitor the node state and keep it healthy
○ checks the health every 5 sec
○ node eviction time is 5 m
○ kubectl get nodes
• Replication Conroller
○ responsible to keep the desired number of pods in node
• Deployment Controller
• Namespace Controller
• Job controller
• Service account controller
• Endpoint controller
• Stateful set
• Cron job

kube-scheduler

• Will decide which pod should be placed in which node and then the kubelet will take care of deployment
• It has some selection criteria in choosing the right pod
○ Filter Nodes
○ Rank Nodes

kubelet

• Registers the node to kubunetes master
• Create POD
• Monitor Node and POD
• kubeadm does not deploy the kubelet service in the worker node

kube-proxy

• Responsible for hosting pods like a service and exposing it through an IP
• It takes care of establishing a connection between pods across multiple different nodes
• It routes traffic using the iptable it maintains

No comments:

Post a Comment