What is Kubernetes?
Kubernetes (K8s) is an open-source, flexible, and extensible platform designed to manage containerized workloads and services. It supports declarative configuration and automation, with a vast and rapidly expanding ecosystem. A wide range of K8s services, tools, and support options are readily accessible.
Containers encapsulate applications and their dependencies, ensuring consistency across development and production environments. K8s extends the power of containers by introducing tools to handle their orchestration. K8s is briefly container orchestration tool.
K8s is designed to accommodate configurations that meet all of the following criteria:
- No more than 110 pods per node
- No more than 5,000 nodes
- No more than 150,000 total pods
- No more than 300,000 total containers
It supports the up to 5000 servers in the cluster, this is the ONE of the reason why it is so popular
Kubernetes Features
- Service discovery and load balancing: K8s can expose a container using the DNS name or using their own IP address. If the traffic to a container is high, K8s is able to load balance and distributes the network traffic so that the deployment is stable.
- Storage orchestration: K8s allows you to automatically mount a storage system of your choice, such as local storages, public cloud providers, and more.
- Automated rollouts and rollbacks: You can describe the desired state for your deployed containers using K8s, and it can change the actual state to the desired state.
- Automatic bin packing: You can define Kubernetes how much CPU and memory (RAM) each container needs. K8s can fit containers onto your nodes to make the best use of your resources.
- Self-monitoring: K8s checks constantly the health of nodes and containers.
- Self-healing: K8s restarts containers that fail, replaces containers, kills containers that don't respond to your user-defined health check
- Automates various manual processes: For example, K8s can control/schedule for you on which server, which container hosts and schedules.
- Interacts with several groups of containers: K8s is able to manage more cluster at the same time.
- Provides additional services: As well as the management of containers, K8s offers security, networking and storage services.
- Horizontal scaling: K8s allows you scaling resources not only vertically but also horizontally.
- Container balancing: K8s always knows where to place containers, by calculating the “best location” for them.
- Run everywhere: K8s is an open source tool and gives you the freedom to take advantage of on-premises, hybrid, or public cloud infrastructure (AWS, Azure, Google Cloud), letting you move workloads to anywhere you want.
- Secret and configuration management: K8s lets you store and manage sensitive information.
Usage Areas of Kubernetes
K8s is a platform that can be applied across various industries and scenarios to optimize application management and infrastructure. Key usage areas include:
Web App: It ensures high availability and scalability of web services.
Microservices: It simplifies the management of complex architectures by orchestrating independent microservices.
CI/CD Pipelines: It automates software deployment processes, ensuring faster releases with minimal downtime.
-
Machine Learning and AI: With support for frameworks like TensorFlow and PyTorch, it aids in scaling machine learning workflows and model training (Kubeflow).
- OpenAI uses K8s to serve: https://kubernetes.io/case-studies/openai/
- Kubeflow runs on K8s: https://www.kubeflow.org/
Big Data and Analytics: It manages distributed data processing tools like Apache Spark and Hadoop.
Gaming Applications: K8s handles dynamic scaling for gaming workloads, ensuring a seamless user experience during fluctuating player activity.
Hybrid and Multi-Cloud Deployments: It enables consistent application management across hybrid or multi-cloud environments, offering flexibility and avoiding vendor lock-in.
Testing and Staging Environments: K8s facilitates the creation of isolated environments for development, testing, and staging, ensuring reliable deployment pipelines.
Key Platforms for Kubernetes
K8s is supported on multiple platforms, including:
Public Cloud Providers: Services like Google Kubernetes Engine (GKE), Amazon Elastic Kubernetes Service (EKS), and Azure Kubernetes Service (AKS) simplify cluster management.
On-Premises: Tools like Rancher, Kubeadm, Kubespray and OpenShift enable organizations to run Kubernetes on local machines.
Hybrid and Multi-Cloud: Kubernetes facilitates seamless workload movement across environments, making hybrid and multi-cloud strategies more practical.
Kubernetes Architecture
-
Control Plane: User enters commands and configuration files from control plane. It controls all cluster.
- API Server: It provides access to the Kubernetes API, serving as the front end for the Kubernetes control plane.
- ETCD: A reliable and highly available key-value store that serves as the backbone for all cluster data in Kubernetes.
-
Scheduler: It monitors newly created Pods without an assigned node and selects a suitable node for them to run on.
- Scheduling decisions consider various factors, including:
- individual and collective resource requirements,
- hardware/software/policy constraints,
- affinity and anti-affinity specifications,
- data locality,
- inter-workload interference,
- deadlines.
- Scheduling decisions consider various factors, including:
-
Controller Manager: It runs controller processes.
- Logically, each controller is a separate process, but to reduce complexity, they are all compiled into a single binary and run in a single process.
- Some types of these controllers are:
- Node controller: Responsible for noticing and responding when nodes go down.
- Job controller: Watches for Job objects that represent one-off tasks, then creates Pods to run those tasks to completion.
- Endpoints controller: Populates the Endpoints object (that is, joins Services & Pods).
- Service Account & Token controllers: Create default accounts and API access tokens for new namespaces"
-
Node: "Node components run on every node, maintaining running pods and providing the Kubernetes runtime environment."
- Kubelet: The kubelet is an agent that runs on each cluster node, ensuring containers in a Pod are running and healthy based on provided PodSpecs.
-
Kube-proxy: It is a network proxy that runs on each node in your cluster, implementing part of the Kubernetes Service concept.
- It maintains network rules on nodes. These network rules allow network communication to your Pods from network sessions inside or outside of your cluster.
- Container Runtime: The container runtime is the software that is responsible for running containers. Containerd is container runtime of K8s
Conclusion
K8s is much more than a tool, it’s a paradigm shift in how we approach application deployment and management. Its ability to enhance scalability, ensure reliability, and optimize resource usage makes it invaluable for modern software development.
This post focuses the usage area and importance of K8s in IT sector. In the next posts, we will focus on the details (k8s commands, pods, deployment, services, jobs, resource limit, secret, use-case scenarios).
If you found the tutorial interesting, I’d love to hear your thoughts in the blog post comments. Feel free to share your reactions or leave a comment. I truly value your input and engagement 😉
For other posts 👉 https://dev.to/omerberatsezer 🧐
Follow for Tips, Tutorials, Hands-On Labs for AWS, Kubernetes, Docker, Linux, DevOps, Ansible, Machine Learning, Generative AI, SAAS.
https://github.com/omerbsezer
https://www.linkedin.com/in/omerberatsezer/
Top comments (0)