Debug School

Vipul Bisht
Vipul Bisht

Posted on

Day 3 Kubernetes Introduction By Vipul Bisht

What is Kubernetes?

Kubernetes is a container orchestration system, extensible open-source platform for managing containerized workloads and services, for automating deployment, scaling, and management of containerized applications.

Why Kubernetes

  • No downtime for deployment
  • Scalable
  • Kubernetes helps developers build the ‘infrastructure as code’ and also helps them manage coding environment configurations as code.
  • It is highly portable, as Kubernetes can be deployed on various infrastructures and environment configurations.
  • Kubernetes, also known as K8s, can handle the storage, networking, and computational aspects of cloud applications on its own.
  • Kubernetes hosts a lot of built-in commands for automating many daily operations.

Explained Kubernetes Architecture

A Kubernetes cluster consists of control plane nodes and worker nodes.

1) Control Plane
The control plane is responsible for container orchestration and maintaining the desired state of the cluster. It has the following components.

  • kube-apiserver
  • etcd
  • kube-scheduler
  • kube-controller-manager
  • cloud-controller-manager

2) Worker Node
The Worker nodes are responsible for running containerized applications. The worker Node has the following components.

  • kubelet
  • kube-proxy
  • Container runtime

Master Components

The Kubernetes master runs the Scheduler, Controller Manager, API Server and etcd components and is responsible for managing the Kubernetes cluster. Essentially, it’s the brain of the cluster. It's components are -

  • Etcd
    Etcd is a distributed, consistent key-value store used for configuration management, service discovery, and coordinating distributed work.

  • API Server
    When you interact with your Kubernetes cluster using the kubectl command-line interface, you are actually communicating with the master API Server component.

  • Controller Manager
    The Kubernetes Controller Manager is a daemon that embeds the core control loops (also known as “controllers”) shipped with Kubernetes.

  • Scheduler
    The Scheduler watches for unscheduled pods and binds them to nodes via the /binding pod subresource API, according to the availability of the requested resources, quality of service requirements, affinity and anti-affinity specifications, and other constraints.

Once the pod has a node assigned, the regular behavior of the Kubelet is triggered and the pod and its containers are created

Worker Components

1) Kubelet is an agent that runs on each worker node and communicates with the master node. It also makes sure that the containers which are part of the pods are always healthy. It watches for tasks sent from the API Server, executes the task like deploy or destroy the container, and then reports back to the Master.

2) Kube-proxy is used to communicate between the multiple worker nodes. It maintains network rules on nodes and also make sure there are necessary rules define on the worker node so the container can communicate to each in different nodes.

3) Kubernetes pod is a group of one or more containers that are deployed together on the same host. Pod is deployed with a shared storage/network, and a specification for how to run the containers. Containers can easily communicate with other containers in the same pod as though they were on the same machine.

4) Container Runtime is the software that is responsible for running containers. Kubernetes supports several container runtimes: Docker, containers.

Workstation Components

Here are some of the components.

  • Kubernetes CLI (kubectl): The Kubernetes CLI, or kubectl, is a command-line tool that allows developers and administrators to interact with Kubernetes clusters from their local workstations. With kubectl, users can create, modify, and delete Kubernetes objects such as pods, services, and deployments.

  • Kubernetes Dashboard: The Kubernetes Dashboard is a web-based UI that provides a graphical interface for managing Kubernetes clusters. It allows users to view the state of the cluster, create and modify objects, and monitor the health of the cluster.

  • Container Registry: A container registry is a service that allows users to store and distribute container images. Developers can use a container registry to store their container images and then deploy those images to a Kubernetes cluster.

  • Text Editor or Integrated Development Environment (IDE): Developers can use a text editor or IDE to write and edit Kubernetes manifests and other configuration files. This can be useful for creating and modifying objects, debugging issues, and troubleshooting problems.

  • Continuous Integration/Continuous Deployment (CI/CD) Tools: CI/CD tools such as Jenkins, CircleCI, and GitLab can be used to automate the deployment of containerized applications to Kubernetes clusters. These tools can be used to build container images, test them, and then deploy them to a Kubernetes cluster.

All of these help to interact with Kubernetes clusters from their local workstations and streamline the development and deployment of containerized applications.

What is POD?

  • Pods are the smallest deployable units of computing that you can create and manage in Kubernetes.

  • A Pod (as in a pod of whales or pea pod) is a group of one or more containers, with shared storage and network resources, and a specification for how to run the containers.

  • A Pod is similar to a set of containers with shared namespaces and shared filesystem volumes.

Top comments (0)