Day 30 - 90daysofdevops - Kubernetes(k8's)

Day 30 - 90daysofdevops - Kubernetes(k8's)

What is Kubernetes?

Kubernetes(k8s) is an open-source tool for automating the deployment, scaling, and management of containerized applications. Basically , it used for orchestra-tor for your containers, ensuring they run smoothly and efficiently.

Note : k8's heavily used in micro services based application !!

Kubernetes helps you achieve following things :

  • Deploying applications: You can easily deploy your containerized applications across a cluster of machines.
  • Scaling applications: Kubernetes automatically scales your applications up or down based on demand, ensuring optimal performance and resource utilization.
  • Managing applications: Kubernetes provides tools for managing your applications, such as monitoring health, restarting failed containers, and rolling out updates.

Why is it called k8s?

The name "Kubernetes" is derived from the Greek word for helmsman or pilot.

The shortened form "k8s" is simply a more convenient way to write the full name. The "8" stands for the number of letters between the "K" and the "s".

Here are some additional facts about the name:

  • The name was chosen by Kubernetes co-founder Joe Beda.
  • There were other contenders for the name, such as "Borg" and "Project 7".
  • The Greek origin of the name is intended to evoke a sense of power and control.

Resources to learn more:

What are the benefits of using k8s?

1. Increased Efficiency and Productivity:

2. Improved Scalability and Agility.

3. Enhanced Portability and Flexibility.

4. Increased Reliability and Availability.

5. Cost Savings.

Explain the architecture of Kubernetes?

The architecture of Kubernetes can be broadly broken down into two main components:

  • Control plane
  • Nodes

Components of Control Plane:

  • API Server: The central command center of the cluster. Exposes REST API for interacting with the cluster. Validates and processes requests from CLI, kubectl, and other components. Stores the desired state of the cluster in etcd.
  • etcd: Distributed key-value store. Stores the current state of the cluster, including pods, services, nodes, and configurations. Highly available and ensures consistent data across all nodes.
  • Scheduler: Watches for newly created pods without assigned nodes. Based on predefined rules and resource availability, assigns pods to nodes.
  • Controller Manager: Runs various controllers, each responsible for a specific task. Examples include: Deployment controller: Manages deployments, ensuring desired number of replicas running. Replicaset controller: Maintains a specified number of identical pod replicas. Service controller: Ensures that services are reachable by pods. Node controller: Manages nodes, detecting and responding to node failures.
  • Cloud Controller Manager: Integrates Kubernetes with cloud providers. Handles tasks like creating and managing cloud resources.

Components of Node:

  • Kubelet: Agent installed on every node. Communicates with the API server to receive instructions. Manages containers on the node, ensuring they run as instructed. Monitors container health and reports back to the API server.
  • Kube-proxy: Network proxy running on each node. Responsible for implementing the Kubernetes networking model. Routes traffic between pods based on network policies and service configurations.
  • Container Engine: Software responsible for running containers on the node. Examples include Docker, containerd, and CRI-O.

Additional Components:

  • kubectl: Command-line tool for interacting with the Kubernetes cluster. Used to manage deployments, pods, services, and other resources.
  • Metrics Server: Collects and stores metrics about the cluster. Provides information about resource usage, pod health, and other aspects of the cluster.
  • Logging Stack: Collects and stores logs from the Kubernetes cluster. Provides insights into the operation and health of the cluster.

Benefits of Kubernetes Architecture:

  • Modular: Each component is responsible for a specific task, making the architecture easy to understand and maintain.
  • Scalable: The control plane and nodes can be scaled independently to meet the demands of your applications.
  • High Availability: The distributed nature of the architecture ensures that the cluster remains operational even if individual components fail.
  • Extensible: The architecture is designed to be extensible, allowing you to add additional functionality through plugins and extensions.

What is Control Plane?

This is the brain of the Kubernetes cluster. It's responsible for managing the state of the cluster and making decisions about how to run applications. The control plane consists of several components, including:

  • API server: This is the single entry point for all interactions with the Kubernetes cluster. It receives requests from users and other components and stores the desired state of the cluster.
  • etcd: This is a distributed key-value store that stores the current state of the cluster.
  • Scheduler: This component is responsible for assigning pods to nodes in the cluster.
  • Controller manager: This component runs various controllers, each of which is responsible for managing a specific aspect of the cluster, such as deployments, replicasets, and services.

Write the difference between kubectl and kubelets.

Explain the role of the API server.

The API server plays a critical role in the Kubernetes architecture. It acts as the central command center for the cluster, responsible for:

1. Receiving and processing requests:

  • This includes requests from user tools like kubectl, controllers, and other components within the cluster.
  • The API server validates and authenticates these requests before processing them.

2. Managing the state of the cluster:

  • The API server stores the desired state of the cluster, including information about pods, services, nodes, and configurations.
  • This state is stored in a distributed key-value store called etcd.

3. Instructing other components:

  • Based on the desired state and the current state of the cluster, the API server instructs other components on what to do.
  • For example, it instructs the scheduler to assign pods to nodes, and it instructs the kubelet agent on each node to run the containers.

4. Handling communication:

  • The API server acts as the central point of communication for all components in the cluster.
  • It facilitates communication between the control plane and the nodes, as well as between different components within the control plane.

5. Providing an interface:

  • The API server exposes a REST API that allows users and other components to interact with the cluster.
  • This API is used to create, delete, and modify Kubernetes resources, as well as to view the status of the cluster.

the API server is the brain of the Kubernetes cluster.


Hope you like this concepts about k8's :)

Happy Learning !!!!!!!

要查看或添加评论,请登录

Prakash Bohara的更多文章

社区洞察

其他会员也浏览了