Skip to main content

Kubernetes - Architecture

 What is Kubernetes:

    Kubernetes is an open source container orchestration system for automating application deployment,     scaling, self-healing, rolling update and roll back.

 

Architecture Diagram:



Master Node / Control Plane components:

  1.     Kube API server
  2.     Scheduler
  3.     Controller Manager
  4.     etcd store


1. Kube API Server:

  •  API server acts as a front-end to kubernetes cluster & exposes the kubernetes cluster API.
  •  API server talks to worker nodes.
  •  API server validates and configures data for the api objects which includes pods, service replica-controllers, deployments etc.
  •  Once request is validated, it stores the cluster data under etcd store.


2. Schedulers:

  •  Scheduler assigns pods to nodes
  •  Scheduler determines which nodes are free and can take a new load. 
  •  Scheduler also checks for constraints before placing the load on any nodes.


3. etcd  store:

  •  Kubernetes uses etcd ro store all cluster data - configuration data, its state and metadata.
  •  Since Kubernetes is a distributed system- it needs a distributed data store like etcd.
  •  etcd manages a lot of the tricky problems in running a distributed database like race conditions.
  •  It also stores the actual state of the system and the desired state of the system in etcd.
  •  It then uses etcd's watch functionality to monitor changes to either of these two things. If they    diverge, Kubernetes makes changes to reconcile the actual state and the desired state.
  •  kubectl get pod --> reads from etcd store data.
  •  Any change you make via kubectl create will write an entry in etcd.


4. Controller Manager:

  •  A kube-controller manager is a daemon which regulates the state of the system. 
  •  A controller is a non terminating loop that watches the state of the cluster via kube api server and makes changes attempting to move the current state to desired state.
  •  example: replica-controllers , end point controllers etc.

Node Components:

  1. Kubelet
  2. Run time environemnt
  3. Kube-proxy

1. Kubelet:

  • Kubelet is a node agent that runs on every node in a kubernetes cluster. 
  • It can register the node with the kube api server using hostname or any other logic.
  • Kubelet takes the podspecs and ensures containers described in podspec or healthy.
  • kubelet doesn't monitor containers which doesn't create via kubernetes.

2. Run time environment:

  • All Nodes should be installed with docker or containerd (container runtime environment)

3. Kube Proxy:

  • Kube proxy is a network proxy which maintains network rules on nodes.


Happy Learning😀
Thank you

Comments

Popular posts from this blog

Kubernetes ETCDCTL

ETCD is a key-value data store for storing kubernetes state and objects. ETCDCTL is the tool used to back up with snapshot. ETCDCTL a command line tool for interacting with the etcd server  Key Features:  Keep the event history until compaction. access to old version of keys. user controlled key compaction. Support range query. pagination support with limit argument. support consistency guarantee across multiple queries. Replace TTL key with lease. Support watch feature. ETCDTOOL Installation: Build binary from source code  Download tool directly  Build binary from source code: Checkout the code repository git clone -b v3.4.16 https://github.com/etcd-io/etcd.git Change directory to etcd cd etcd Run build script ./build The binaries are under the bin directory. exportPATH="$PATH:`pwd`/bin" Check etcd version etcd --version Download ETCD tool directly: kubectl exec -it etcd-docker-desktop -n kube-system -- /bin/bash -c 'ETCDCTL_API=3 /usr/local/bin/etcd --version' | ...

Selenium Basic Commands.

Selenium Commands, Packages and Exceptions. Here I have selected few most frequently asked commands in the interview. Recommended way of Importing webdriver from selenium package. from selenium import webdriver. Once webdriver is imported then you are able to access the classes like this webdriver.Firefox webdriver.FirefoxProfile webdriver.Chrome webdriver.ChromeOptions webdriver.Ie webdriver.Opera webdriver.PhantomJS webdriver.Remote webdriver.DesiredCapabilities webdriver.ActionChains webdriver.TouchActions webdriver.Proxy To launch the application URL: driver = webdriver.Chrome driver.get('http://youtube.com') To get URL of the currently loaded page: driver.current_url To close the current window: driver.close() Exceptions in Selenium: Base Exception class: Selenium.common.exceptions selenium.common.exceptions.WebDriverException selenium.common.exceptions.InvalidElementStateException selenium.common.exceptions...

PODS, SERVICES & DEPLOYMENTS

PODS Pod is a wrapper to container and it is the smallest deployable unit in Kubernetes. pod yaml configuration   Pod Useful Commands: $kubectl version --short Client Version: v1.22.4 Server Version: v1.22.4 $kubectl get svc NAME         TYPE        CLUSTER-IP      EXTERNAL-IP   PORT(S)   AGE kubernetes   ClusterIP   10.96.0.1                    <none>           443/TCP   5d20h $kubectl get nodes NAME             STATUS   ROLES                       AGE     VERSION docker-desktop   Ready    control-plane,master   3d23h   v1.22.4 $kubectl cluster-info Kubernetes control plane is running at https://kubernetes.docker.internal:6443 Core...