Why and how to get started with Kubernetes? Main components, concepts ...and reasons
With the widespread adoption of containers in organizations, Kubernetes has become the de facto standard for deploying and running containerized applications. In this article, we will explain the principle of container orchestration, which is the key to managing scalable and resilient applications in the cloud.
Roman Zubryckyj
What does Kubernetes mean?
Kubernetes (also known as K8s or cube) is a portable extensible open source platform for managing containerized tasks and serviceswhich allows declarative configuration and automation.
Kubernetes provides a platform-agnostic framework for deploying and managing containerized applications on-premise, in a hybrid solution, or in the cloud. Its name comes from Greek and means helmsman or pilot (short for K8s was then formed by adding the eight letters between the letters K a s).
Kubernetes was originally developed at Google (internal cluster management system Borg). It was released as an open source solution in 2014 and is now maintained by the Foundation Cloud Native Computing Foudation (CNCF).
What is Kubernetes for?
Containers are defined as the software units in which the application code with all libraries and dependencies is packaged. They allow fast running applications in any environment - on-premises, in a private data centre or in a public cloud.
In a production environment, however, you need to manage hundreds of containers and ensure that there are no outages. And if an outage does occur, a new container must be started. Is there a way to handle such situations automatically across the system? Kubernetes, which provides a framework for the resilient operation of distributed systems, enables just that. It takes care of scaling and failover of your applications (switching to the backup system).
That doesn't quite make sense. What am I associating? Microservices in the form of containers to applications? Applications into entire business systems?
This is key information, and it's marketable.
The main benefits of Kubernetes
- Automated operationsthat allow us to manage applications efficiently.
- Infrastructure abstractionwhich allows developers to focus on applications instead of the core environment.
- Monitoring the status of services and restarting or making them available only when they are fully functional.
Kubernetes is not a traditional PaaS systembecause it works at the container level and offers generic features for deployment, scaling or load balancing. At the same time, it allows users to integrate their own logging and monitoring solutions. Kubernetes does not prescribe or build applications from source code and does not provide a specific configuration language.
This paragraph was originally used as an editorial. However, it is not suitable for it. I suggest using the essential sentences in this section. We can incorporate them into the three paragraphs above or include some bulleted list of benefits here.
Kubernetes components
Now that we understand what Kubernetes is for, we can dive into its basic components. These core components work together to automate the deployment and management of containerized applications.
Schematic of Kubernetes components
Components of the Control Plane
- kube-apiserver makes the Kubernetes API accessible. The API server is the frontend for the Kubernetes control plane.
- etcd is a consistent and highly available key-value store used as a backup Kubernetes repository for all cluster data.
- kube-scheduler identifies the correct nodes to place the container on based on node capacity (CPU, storage, RAM), policies, constraints, and other filters.
- kube-controller-manager starts the controller processes:
- Node controller Responsible for notifications when a node fails.
- Job controller tracks task objects that are one-off tasks.
- EndpointSlice controller provides the connection between Services and Pods.
- ServiceAccount controller is responsible for creating default ServiceAccounts for new Namespaces.
- cloud-controller-manager allows you to connect your cluster to the cloud provider's APIs and separate components that communicate with that cloud platform from components that communicate only with your cluster.
Nodu components
- kubelet is an agent that runs on every node in the cluster. It ensures that containers are running in the Pod.
- kube-proxy is a network proxy that runs on every node in the cluster and maintains network rules on the nodes.
runtime container enables efficient operation of Kubernetes containers. The component is responsible for managing the startup and lifecycle of containers (containerd, CRI-O).
Basic concepts of Kubernetes
It is now time to explore the basic concepts underlying the interaction of these components. By understanding them, we will get closer to working effectively with Kubernetes in real-world scenarios.
By the way - in the best way, how to get started with Kubernetes, is to interact with a real cluster, either through a local cluster or a playground.
- Cluster is a group of nodes running container applications. You use Kubernetes to manage the cluster and everything it contains (especially applications).
- Node is a physical or virtual machine in the cluster. This "working" machine has everything needed to run containers and other important services.
- Container is a lightweight, portable, and isolated environment that packages the application and its dependencies and enables consistent deployment across environments. Popular containerization technologies include Docker a containerd.
- Under is the smallest unit in Kubernetes. A pod represents one or more containers that are deployed together on the same host.
- Deployment is used to manage the application deployment lifecycle. It defines the desired state of the application, including the number of replicas (pods) to be run, the container image to be used, and the upgrade strategy. It ensures that the desired state is maintained, automatically scales up or down depending on changes in demand, and deploys updates with minimal downtime.
- Service is an abstract way to expose an application running on a set of pods as a network service. It enables load balancing and service discovery within a cluster. It provides a way for applications to communicate with each other, both internally and externally.
- Namespace provide a mechanism for isolating groups of resources within a cluster, typically corresponding to a single application environment.
- Secret is a means of storing sensitive information, such as an OAuth token or SSH key, so that it can be accessed by pods in the cluster when needed. At the same time, sensitive information must be protected from unnecessary visibility increasing security risk.
- Kubernetes API allows you to query and manipulate the status of API objects in Kubernetes using a command line interface tool kubectl or kubeadm, which in turn use APIs.
This paragraph was originally used as an editorial. However, it is not suitable for it. I suggest using the essential sentences in this section. We can incorporate them into the three paragraphs above or include some bulleted list of benefits here.
Conclusion of the introduction
We've had a brief introduction to Kubernetes. In a follow-up article, we'll dive into the capabilities of its Deployment (self-hosted, managed k8s), we'll take a look at prices (TCO), life cycle management or at safety principles