Kubernetes is an open-source container orchestration tool that offers scalability, No downtime of software, and disaster recovery like backup and restores. Also, it is peculiar for its automated deployment features and comprehensive management of containerized applications like Docker, contained, CRI-O to write a few in all / any environment e,g on-premises, hybrid, Cloud environments.
Kubernetes Architecture
The Cluster has One Master Node, which can be running on either Docker Container or Virtual Machine depending on preference. The master Node is connected to Worker Nodes (has multiple Worker Nodes )- Node1, Node2, Node3, this is where applications are running.
In each Node, a kubelet process is running, allowing execution of tasks on each worker node (running application processes)and great cluster Communication among nodes. Each node has multiple Docker containers of different applications running on it.
In the Master Node, several Kubernetes processes are running which help to manage the cluster effectively. The processes include;
- API server – A container too. This is the entry point to Kubernetes Cluster (where Kubernetes clients will communicate to) either the UserInterface if using Kubernetes Dashboard, API if using Scripts, and CLI if using automation.
- Controller Manager – It Keeps track of activities in the cluster: container restart or repair
- Scheduler – scheduling containers on different node-assigning process tasks to worker nodes based on workload.
- etcd – stores configuration data and holds current status data of each node, container of each node. Backup snapshots are from etcd for recovery.
Kubernetes Components
A web application and a Database makes a full Kubernetes component
Pod is the smallest unit in Kubernetes, it is an abstraction over a container, creates a running environment or layer on top of a container. one main application runs in a pod. each pod has its own IP address, which can communicate with each other like DB + WebApp
Service is a static IP address attached to each Pod (WebApp pod and DB Pod) however, there is no IP address change when Pod restarts or has been restored. Pod and service not connected.
Ingress helps Applications to be accessible through a browser, thus, create an External service that opens communication from external sources, however, it is best to create Internal Service to avoid exposure to databases online which often is specified when creating; http://nodeIPaddress:port or http://192.168.1.13:27017 but with Ingress, it forwards IP to services thus having a secured protocol with a domain name “https://myWebApp.com”
ConfigMap – It is a DB endpoint used to communicate with a Database URL. Database URL is in the built Application, it is an external configuration of your application with DB user and Password and connects to Pod
Secret stores credentials of the Pod like Username and Password , SSL certificates and its stored base64 code format for security purposes and connect to Pod
Data Storage — Attached an external physical HDD on local machine or remote
Deployment – A clone of the application,connects to same service and a service serves as a load balancer
For a second replica, define blueprint for Pods to specify how many replicas you would like to run, the blueprint is the Deployments.
Database replica can’t be deployed because it it stateful.
- Stateful set is mainly used for Databases and stateful applications.
- Daemon set