(K8s -- Kubernetes) K ubernetes is a software tool that is used to manage, run, and monitor the dockerized application, a cluster of nodes. ...
- Kubernetes is a software tool that is used to manage, run, and monitor the dockerized application, a cluster of nodes.
- It is a client-server architecture, open-source orchestration engine developed by Google.
- It will check the application's stability continuously. If the application went down Kubernetes itself restarted the application.
- Provide highly resilient infrastructure, Zero downtime, scaling, and automatic rollback.
The Architecture of Kubernetes:
k8s Architecture is a client-server model.
Kubernetes used two nodes
1. Master Node or ControlPlane Node
2. Worker Node
By default Kubernetes uses a single master node, For high availability purposes, we can use more than one master node.
Master node:
The master node is called the controlling node.
It will manage and monitor all worker nodes so-called a controlling node.
Master node components:
1. etcd
2. Api server
3. Controller manager
4. Scheduler
etcd:
It is a distributed key-value database,
We used to store all data which is used in the Kubernetes cluster, for Example (pod count, pod status, metadata, deployment status).
Etcd which access only using the API server.
API server:
It is mainly used to communicate with the entire Kubernetes cluster.
It is like the front end for the entire Kubernetes cluster.
Using the API server we can communicate with the Kubernetes cluster.
We can trigger the API server using the number, of clients. We can able to modify the configuration.
Controller Manager:
1. kube-controller-manager
2.Cloud-controller-manager
kube-controller-manager:
- Node controller: Responsible for noticing and responding when nodes go down.
- Job controller: Watches for Job objects that represent one-off tasks, then creates Pods to run those tasks to completion.
- EndpointSlice controller: Populates EndpointSlice objects (to provide a link between Services and Pods).
- ServiceAccount controller: Create default ServiceAccounts for new namespaces
cloud-controller-manager:
A Kubernetes control plane component that embeds cloud-specific control logic.
The cloud controller manager lets you link your cluster into your cloud provider's API, and separates out the components that interact with that cloud platform from components that only interact with your cluster.
- Node controller: For checking the cloud provider to determine if a node has been deleted in the cloud after it stops responding
- Route controller: For setting up routes in the underlying cloud infrastructure
- Service controller: For creating, updating, and deleting cloud provider load balancers
Scheduler:
It will be used to schedule the podes.
For example: if we want to create a new application that needs memory and space, it will check the worker node for free memory and
free space and schedule the pod in the worker node.
Worker Node:
Kubelet
Kube-proxy
Container run time
Kubelet:
It will monitor the running status of containers running inside the pod. The kubelet works in terms of a PodSpec. A PodSpec is a YAML or JSON object that describes a pod. Using the kubelet agent the master node communicates with the worker node
Kube-proxy:
kube-proxy is a network proxy that runs on each node in your cluster, implementing part of the Kubernetes Service concept.
kube-proxy maintains network rules on nodes. These network rules allow network communication to your Pods from network sessions inside or outside of your cluster.
Container run time:
A fundamental component that empowers Kubernetes to run containers effectively. It is responsible for managing the execution and lifecycle of containers within the Kubernetes environment.
Kubernetes supports container runtimes such as containerd, CRI-O, and any other implementation of the Kubernetes CRI (Container Runtime Interface).
Addons: Addons use Kubernetes resources (DaemonSet, Deployment, etc) to implement cluster features
- Networking and Network Policy add-ons (calico, cilium, flannel, ACI, etc)
- Service Discovery addons(CoreDNS)
- Visualization & Control add-ons (Dashboard, Weave scope)
- Infrastructure addons(kubevirt)
- Instrumentation addons(kube-state-metrics)
While the other add-ons are not strictly required, all Kubernetes clusters should have cluster DNS, as many examples rely on it.
In kubernetes, if you are working in cloud hosting providers such as AWS, Azure, and GCP cloud providers themselves manage the master node. we need to manage only the worker node.
List of Kubernetes-hosted providers
AWS - Elastic Kubernetes Service(EKS)
Azure - Azure Kubernetes Service(AKS)
Google - Google Kubernetes Engine(GKE)
Alibaba Cloud - Container Service for Kubernetes.
Digital ocean Kubernetes
IBM Kubernetes.
Oracle Container Engine for Kubernetes. ...etc