Day 30 Task: Kubernetes Architecture

Day 30 Task: Kubernetes Architecture

Kubernetes Overview:

With the widespread adoption of containers among organizations, Kubernetes, the container-centric management software, has become a standard to deploy and operate containerized applications and is one of the most important parts of DevOps.

Originally developed at Google and released as open-source in 2014. Kubernetes builds on 15 years of running Google's containerized workloads and the valuable contributions from the open-source community. Inspired by Google’s internal cluster management system, Borg.

What is Kubernetes? Write in your own words and why do we call it k8s?

Kubernetes is an open-source platform that automates the deployment, scaling, and management of containerized applications. It was designed to simplify the process of running and managing containers in large-scale, multi-node environments.

The name "k8s" is simply a shorthand for "Kubernetes". The number 8 represents the number of letters skipped between the "K" and the "s" in the word "Kubernetes".

What are the benefits of using k8s?

🛡️ Reliability: Keep apps running even when things go wrong.

🌐 Efficiency: Use resources wisely for cost savings.

🔒 Security: Protect apps with strong guards and barriers.

🔄 Updates: Easily update apps without disruptions.

📦 Consistency: Ensure uniformity across all app parts.

⚙️ Automation: Handle routine tasks automatically.

🌍 Multi-Platform: Works on various devices and clouds.

📊 Monitoring: Keep an eye on app performance.

Explain the architecture of Kubernetes:

1. Master Node: The Brain The master node is like the control center that manages and coordinates everything in the Kubernetes cluster. It consists of several components:

  • API Server: Acts as a communication hub for all parts of the cluster.

  • Etcd: A database that stores configuration and state information.

  • Controller Manager: Ensures the desired state of the cluster.

  • Scheduler: Assigns work (pods) to worker nodes based on available resources.

2. Node (Minion) Nodes: The Workers Nodes are the machines where your applications run. Each node has:

  • Kubelet: Communicates with the master node, ensuring pods are running as intended.

  • Kube Proxy: Manages network communication between pods and services.

3. Pod: Smallest Deployable Unit A pod is a group of one or more containers that share resources and network. It's like a single apartment where related tasks live together.

4. Service: Network Communication Services provide a consistent way for pods to communicate with each other or the outside world. They act as virtual IP addresses and load balancers.

5. Deployment: Managing Updates Deployments handle rolling out updates to your application. They manage the desired number of replica pods, allowing easy scaling and rollbacks.

6. ReplicaSet: Ensuring Availability ReplicaSets ensure a specified number of identical pods are running at all times. They replace failed pods to maintain availability.

7. Namespace: Logical Division Namespaces provide a way to divide a cluster into virtual sub-clusters. They help organize and manage resources, preventing conflicts.

Components of Kubernetes Architecture - Techdozo

What is Control Plane?

The Control Plane in Kubernetes is like the boss of the cluster. It manages and controls everything, making sure apps run smoothly. It has components like the API server for commands, Etcd for memory, Controller Manager for coordination, and Scheduler for tasks. It's the brain that keeps the cluster in order.

Write the difference between kubectl and kubelets:

kubectl is the command-line interface (CLI) tool for working with a Kubernetes cluster. It communicates with the API server to perform various operations on the cluster, such as deploying applications, scaling resources, and inspecting logs.

Kubelet is the technology that applies, creates, updates, and destroys containers on a Kubernetes node.

  • You Use It: Like a remote control for managing the cluster.

  • What It Does: Helps you give commands to create, modify, or check things in the cluster.

  • Example: Like telling the cluster to start an app.

kubelet:

  • It Works: Like a caretaker on each computer in the cluster.

  • Its Job: Makes sure the apps are running well on that computer.

  • Example: Keeps an eye on the apps and fixes them if they're not working.

Explain the role of the API server:

The API server in Kubernetes is like a communication hub that listens and responds to commands, requests, and information from various sources. It acts as a bridge between users, applications, and different parts of the Kubernetes cluster.

Role of the API Server:

  1. Command Center: The API server is the main point of interaction for users, administrators, and other components to communicate with the cluster.

  2. User Commands: It receives commands from users through the Kubernetes command-line tool (kubectl) or other interfaces.

  3. Resource Management: It manages various resources in the cluster, such as pods, services, deployments, and more. It creates, updates, and deletes these resources based on the instructions it receives.

  4. Validation and Authentication: The API server checks if the commands and requests are valid, ensuring that they follow the right format and adhere to security policies.

  5. Scaling Control: It helps with scaling applications by allowing users to request more instances of an app when needed.

Thanks for reading. Happy Learning.