Kubernetes Is Easy

Kubernetes Is Easy

·

4 min read

Before getting started with it is important to know about container and containers orchestration so firstly let's understand this concept

Container orchestration

• Container orchestration automates the deployment, management, scaling, and networking of containers across the cluster. It is focused on managing the life cycle of containers.

• Enterprises that need to deploy and manage hundreds or thousands of Linux® containers and hosts can benefit from container orchestration.

• Container orchestration is used to automate the following tasks at scale:

✓ Configuring and scheduling of containers

✓ Provisioning and deployment of containers

✓ Redundancy and availability of containers

✓ Scaling up or removing containers to spread application load evenly across host infrastructure

✓ Movement of containers from one host to another if there is a shortage of resources in a host, or if a host dies

✓ Allocation of resources between containers

✓ External exposure of services running in a container with the outside world

✓ Load balancing of service discovery between containers

✓ Health monitoring of containers and hosts

Kubernetes

• Kubernetes also known as K8s, is an open-source Container Management tool

• It provides a container runtime, container orchestration, container-centric infrastructure orchestration, self-healing mechanisms, service discovery, load balancing and container (de)scaling.

• Initially developed by Google, for managing containerized applications in a clustered environment but later donated to CNCF

• Written in Golang

• It is a platform designed to completely manage the life cycle of containerized applications and services using methods that provide predictability, scalability, and high availability.

Kubernetes Cluster

A Kubernetes cluster is a set of physical or virtual machines and other infrastructure resources that are needed to run your containerized applications. Each machine in a Kubernetes cluster is called a node.

There are two types of node in each Kubernetes cluster:

Master node(s): hosts the Kubernetes control plane components and manages the cluster

Worker node(s): runs your containerized applications

Kubernetes Architecture

Kubernetes Master

• Master is responsible for managing the complete cluster.

• You can access master node via the CLI, GUI, or API

• The master watches over the nodes in the cluster and is responsible for the actual orchestration of containers on the worker nodes

• For achieving fault tolerance, there can be more than one master node in the cluster.

• It is the access point from which administrators and other users interact with the cluster to manage the scheduling and deployment of containers.

• It has four components: ETCD, Scheduler, Controller and API Server

ETCD

• ETCD is a distributed reliable key-value store used by Kubernetes to store all data used to manage the cluster.

• When you have multiple nodes and multiple masters in your cluster, etcd stores all that information on all the nodes in the cluster in a distributed manner.

• ETCD is responsible for implementing locks within the

cluster to ensure there are no conflicts between the Masters

Scheduler

• The scheduler is responsible for distributing work or containers across multiple nodes.

• It looks for newly created containers and assigns them to Nodes.

API server manager

• Masters communicate with the rest of the cluster through the kube-apiserver, the main access point to the control plane.

• It validates and executes user’s REST commands

• kube-apiserver also makes sure that configurations in etcd match with configurations of containers deployed in the cluster.

Controller manager

• The controllers are the brain behind orchestration.

• They are responsible for noticing and responding when nodes, containers or endpoints goes down. The controllers makes decisions to bring up new containers in such cases.

• The kube-controller-manager runs control loops that manage the state of the cluster by checking if the required deployments, replicas, and nodes are running in the cluster

Kubectl

• kubectl is the command line utility using which we can interact with k8s cluster

• Uses APIs provided by API server to interact.

• Also known as the kube command line tool or kubectl or kube control.

• Used to deploy and manage applications on a Kubernetes

Kubernetes Worker

Kubelet

• Worker nodes have the kubelet agent that is responsible for interacting with the master to provide health information of the worker node

• To carry out actions requested by the master on the worker nodes.

Kube proxy

• The kube-proxy is responsible for ensuring network traffic is routed properly to internal and external services as required and is based on the rules defined by network policies in kube-controller-manager and other custom controllers.

That's a wrap......