Kubernetes Architecture and Components, Kubernetes Installation and Configuration
Kubernetes Architecture :
Pod: A group of one or more containers. the smallest unit of k8s.The container has no ip address Pod has an IP address.
If the pod fails, then that pod will not be created again, another new pod will be created and its IP will be different.
kubelet: Kublet is a small, lightweight Kubernetes node agent that runs on each node in a Kubernetes cluster. It's responsible for managing the nodes and communicating with the Kubernetes master. It's also responsible for making sure that the containers running on the nodes are healthy and running correctly.
Kube-proxy: Kube-proxy is a network proxy service for Kubernetes that is responsible for routing traffic to different services within the cluster. It is responsible for forwarding traffic from one service to another, allowing for communication between different components of the Kubernetes cluster.
Service:
In Kubernetes, a service is an object that abstracts the underlying infrastructure and provides a unified access point for the applications that are running on the cluster. Services allow the applications to communicate with each other and are used to provide load balancing and service discovery.
cluster: In Kubernetes, a cluster is a set of nodes (physical or virtual machines) that are connected and managed by the Kubernetes software.
Container Engine(Docker, Rocket, ContainerD): A container engine is a software system that enables applications and services to be packaged and run in an isolated environment. Docker, Rocket, and ContainerD are all examples of container engines that are used to run applications in containers.
API Server (Application Programeble Interface)-
The API Server is the entry point of K8S Services. The Kubernetes API server receives the REST commands which are sent by the user. After receiving them, it validates the REST requests, processes them, and then executes them. After the execution of REST commands, the resulting state of a cluster is saved in 'etcd' as a distributed key-value store. This API server is meant to scale automatically as per load.
it is the front end of the control plane.
ETCD
It is an open-source, simple, distributed key-value store that is used to store cluster data. It is part of a master node which is written in a GO programming language.
stores metadata(data of data) and stores cluster
information about the state of the cluster
Consistent and highly-available key value store used as Kubernetes' backing store for all cluster data.
- Controller Manager - The Kubernetes Controller Manager (also called kube-controller-manager) is a daemon that acts as a continuous control loop in a Kubernetes cluster. The controller monitors the current state of the cluster via calls made to the API Server and changes the current state to match the desired state described in the cluster’s declarative configuration.
Kubernetes resources are defined by a manifest file written in YAML. When the manifest is deployed, an object is created that aims to reach the desired state within the cluster. From that point, the appropriate controller watches the object and updates the cluster’s existing state to match the desired state.
- Scheduler - The scheduler in a master node schedules the tasks for the worker nodes. And, for every worker node, it is used to store the resource usage information.
In other words, it is a process that is responsible for assigning pods to the available worker nodes
Handles pod creation and management.
If you have written that I have to make pode 3 in a container then Sachduler Pod 3 in the container will be made
If you have not written in which pod to create the container, then the scheduler itself will also do the work of creating the container.
- Control Panel/plane: Kubernetes Control Panel is a web-based user interface.
The control plane manages the worker nodes and the Pods in the cluster.
- What is kubectl stand for?
Kubectl stands for “Kubernetes Command-line interface”. It is a command-line tool for the Kubernetes platform to perform API calls. Kubectl is the main interface that allows users to create (and manage) individual objects or groups of objects inside a Kubernetes cluster.
Kubernetes Installation and Configuration:
make sure you choose t2.medium for master nodes
sudo apt-get update
sudo apt-get install
docker.io
-y
curl -LO
https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64
sudo install minikube-linux-amd64 /usr/local/bin/minikube
minikube start
and when this type of error is coming then don't worry
use this👇👇👇
minikube start --driver=docker
sudo usermod -aG docker $USER && newgrp docker
minikube start --driver=docker
docker ps
minikube ssh
(inside the minikube)
docker ps
exit
sudo snap install kubectl --classic