Table of contents
π Introduction to Kubernetes
Kubernetes, also known as K8s, has become the de facto industry standard for container orchestration in modern application development since its debut on Google Cloud and its designation by the Cloud Native Computing Foundation (CNCF). It is an open-source containerized application that's used for application deployment, scalability, and maintenance. Furthermore, it enhances application administration by automating operational tasks associated with container management and providing built-in commands for application deployment.
ποΈ Architecture of Kubernetes
π Kube-API Server: Fundamental and most significant component of a Kubernetes cluster. The main purpose is to create a trustworthy and impartial interface for interacting with the cluster's resources over an HTTP endpoint. Using the KPI Server, it offers a RESTful interface to make managing cluster configuration, resource scalability, and application deployment simple.
ποΈ ETCD: Distributed, consistent key-value store that is a critical component of many distributed systems, especially when it comes to cluster configuration and maintenance. It was initially developed by CoreOS and is now extensively used due to its dependability, usability, and performance.
π€ Kube-Controller Manager: Responsible for managing a number of cluster controllers to ensure that resources and functions are kept in the proper states and use control loops. Each control loop is centered around a particular resource or functionality. Resource managers are responsible for provisioning and scaling pods, nodes, services, replica sets, and other resources as needed. It continuously checks the status of the resources and adjusts any inconsistencies to move the cluster closer to the optimal configuration.
βοΈ Cloud-Controller Manager: A crucial part of Kubernetes that specializes in interacting with and managing interactions with particular cloud providers. Its main function is to provide smooth integration of Kubernetes clusters with the underlying cloud architecture to take advantage of cloud-specific services and resources. It acts as a bridge between Kubernetes and various cloud service providers, including Azure, Google Cloud Platform, and Amazon Web Services (AWS).
π Kube Scheduler: Kubernetes cluster that coordinates the pod deployment onto available nodes. The main goal is to use a variety of factors to make intelligent and efficient decisions about the placement of pods, ensuring high availability, efficient load balancing, and optimal resource utilization. It helps distribute workloads evenly across nodes, preventing resource bottlenecks and optimizing cluster performance The Kube Scheduler's cluster-scaling architecture enables it to efficiently handle scheduling decisions even in large, complex environments.
Worker Nodes:
π₯οΈ Kubelet: "node agent" that runs on each node to register the node with the apiserver using the hostname for a cloud provider. It provides the foundation of Kubelet operations in a YAML or JSON object that contains a pod's description.
π Kube Proxy: Network proxy that operates on each node in your cluster put some of the Kubernetes Service idea into practice. It records network rules on nodes by network rules allow network sessions, either inside or outside of your cluster, to interact with your pods.
π³ Container Runtime: In charge of managing and operating containers on a host system. These are small, segregated environments that bundle an application that containers are created, started, stopped, and managed.
Core Concepts of Kubernetes:
π Pod - The Smallest Deployable Unit
A "workload" in Kubernetes is the collection of programs or tasks that must be run and maintained inside the cluster. The idea of a "Pod," the smallest deployable element in the Kubernetes ecosystem, is at the heart of Kubernetes workloads. Imagine a pod as a single instance of a container or process operating on a cluster node. This is a thorough explanation of a Pod's function in Kubernetes workloads. Within Kubernetes, a pod is a single, logical deployment unit. It acts as an encapsulation or wrapper for one or more closely related containers that have the same lifecycle, storage, and network namespace.
π Replica Sets - Ensuring Desired Pod Replicas: Replica sets are essential Kubernetes controllers that help to manage the deployment and scaling of pods in order to ensure a certain number of replicas is constantly up and running. They are crucial to maintaining the dependability and availability of programs within a cluster. It provides a way to indicate the number of identical pod replicas that should be running in a Kubernetes cluster. This ensures that the applications have the redundancy needed for high availability.
π’ Deployments: Give declarative updates to applications and oversee the availability of the application during updates and scaling, ensuring that the necessary number of replica pods is running for stateless systems, like as web servers, where maintaining a specific number of clones is more important than preserving state.
π Replica Controller: A lower-level resource, is responsible for maintaining the viability of a specific number of replica pods. It guarantees that a certain number of active pod replicas to maintain the required number of replicas running, the controller automatically replaces a pod that fails or is deleted.
π’ Stateful Set: Deploying stateful applications, like distributed storage systems or databases, requires the use of stateful sets. They facilitate the management and scalability of stateful systems by giving each pod a unique network identity and a stable, predictable hostname. When data integrity and state maintenance are critical, stateful sets are used.
π Node: The discrete machines that comprise a Kubernetes cluster are called nodes. They may be virtual machines or real servers. Every node is under the supervision of the master control plane and executes containerized apps.
π·οΈ Label: In Kubernetes, labels are key-value pairs that are applied to nodes, services, and pods, among other items. They are employed in the sorting, organizing, and selection of resources according to particular traits or qualities.
π Annotations: are metadata that offer further details about an object. Usually, non-identifying data is stored in them for debugging, tooling, or documentation needs.
π Advanced Concepts in Kubernetes
Helm, a package manager for Kubernetes, which are custom controllers for managing complicated applications, and Custom Resource Definitions to expand the Kubernetes API with custom resources, are examples of advanced concepts in Kubernetes.
π¦ Persistent Volumes: Storage resources represent the underlying storage architecture and are used for abstraction. They offer a means of managing storage apart from pods and enable data to survive longer than the lifetime of individual pods.
πΌ Storage Class: Storage configurations and providers are defined by Storage Classes. They are employed in the dynamic provisioning of persistent volumes according to specified classes.
π₯ Persistent Volume Claim: A pod makes a request for storage through a persistent volume claim. A Persistent Volume Claim is created by a pod requesting storage, and it binds to a Persistent Volume that satisfies the claim's specifications.
π Service: Kubernetes services offer networking abstraction so that pods can be made visible to other services or outside clients. Within the cluster, they guarantee load balancing, service discovery, and dependable communication.
π Ingress Controller: Under Kubernetes, an Ingress Controller controls external access to services inside the cluster. It sets up rules based on hostnames and paths to route HTTP and HTTPS traffic to various services.
π Config: In Kubernetes, "config" refers to configuration information that can be used as environment variables or mounted onto pods as files. It makes it possible to keep application code and configuration separate.
π€« Secrets: are used to safely store private data like passwords, API keys, and certificates. They can be mounted as volumes or utilized as environment variables in pods since they are encoded.
π Role-Based Access Control (RBAC): RBAC is a policy framework in Kubernetes that establishes and limits permissions for service accounts and users. It permits precise control over
π Ingress Controller: An Ingress Controller is a Kubernetes resource that manages external access to services within the cluster. It configures rules for routing HTTP and HTTPS traffic to different services based on hostnames and paths.
π Config: refers to configuration data that can be mounted into pods as files or consumed as environment variables. It allows for the separation of configuration from application code.