25.07.2023

What is Kubernetes?

Application deployment processes have changed considerably in recent years and the practice of application containerisation has spread. It is a packing method for apps and their dependencies into isolated containers that can be deployed and executed in virtually any runtime environment. A popular container orchestration platform is Kubernetes, and it provides tools to automate the deployment, scaling and management of containerised applications, reducing the complexity and effort required for these operations.

K8S. What is it in simple terms

Kubernetes (k8s) is an open, extensible platform for automating the deployment, scaling and management of containerised applications developed by the Google team. It provides a set of features and tools to efficiently manage containers with apps in distributed environments.

K8s key benefits:

K8S history

The history of Kubernetes began with Google's project to develop a system for managing scalable applications internally. In 2003, Google began using a system called Borg to manage its distributed applications and resources across the company. Borg provided automatic deployment, scaling, monitoring, and resource management.

In 2014, Google engineers decided to create an open and accessible version of a container management system based on the experience and principles of Borg. They began developing a project called Kubernetes. Google believed that containerisation and app orchestration were important parts of developing and managing modern apps, and decided to share their knowledge and tools with the wider developer community.

Google announced the first public version of Kubernetes in June 2014. The platform was released as open source and handed over to the Cloud Native Computing Foundation (CNCF), an organization that supports the development of cloud technologies and projects. Since its release, Kubernetes has received widespread support and attracted tremendous attention from the developer community and industry. It has become the de facto standard for managing containerised applications. And now it is one of the most actively developing projects in the CNCF.

Kubernetes continues to evolve today. It is attracting more and more companies and organizations who use it to manage their apps across different infrastructures. Kubernetes provides powerful tools for deploying, scaling and managing applications on various platforms, including cloud providers such as Serverspace and on-premises environments.

k8s has undergone significant changes and development in recent years, and is now an integral part of modern Devops and cloud application development. There were a lot of new versions with new features and improvements. Companies and organisations around the world are actively using Kubernetes to manage their container applications. The ecosystem around the platform is constantly growing.

Kubernetes architecture

1. Master Node, or Control Plane Node. There most of the important tasks of managing and administering a k8s cluster are performed. It consists of four main components:

2. Nodes are used to refer to the physical or virtual machines on which the containers run and operate. Each node represents a Worker Node in a Kubernetes cluster. The node is the execution environment for the containers and provides resources and facilities for executing applications in the containers. The node runs a Kubernetes agent called Kubelet, which manages the lifecycle of containers and pods on this node.

Each node has its own computing resources (CPU, memory, storage) and network interfaces. Nodes are connected to Master Nodes via network to exchange information about cluster status and receive commands to place and manage containers.

3. Pods are a basic and minimal deployable unit that brings one or more containers together and provides them with an isolated runtime environment. Pods are the basic building block for hosting and managing containers in Kubernetes.

4. Services: An abstraction that provides a persistent access point to a group of pods and load balancing between them.

5. Optional components:

Kubernetes tasks

The container management system performs a number of important tasks related to container management:

Kubernetes installation process

The Kubernetes service you can order in the Serverspace control panel by selecting the version, cluster location and configuring CPU, RAM and number of nodes. There you can also connect the Dashboard in the panel. But how to start working?

You can create and delete clusters, change their configuration, and add and remove nodes via our control panel. For other tasks, you will need command line tools specifically designed to work with clusters.

kubectl is a Kubernetes command utility. With it, you can run a variety of commands to interact with your Kubernetes clusters. Kubectl provides the ability to deploy applications, monitor and manage cluster resources, and view logs. For a full list of kubectl features, see the official documentation available on the Kubernetes website.

Let's look at the utility installation on Ubuntu. Firstly you need to use the following command:

sudo apt-get update && sudo apt-get install -y apt-transport-https
curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key add -
echo "deb https://apt.kubernetes.io/ kubernetes-xenial main" | sudo tee -a /etc/apt/sources.list.d/kubernetes.list
sudo apt-get update
sudo apt-get install -y kubectl

To connect to a Kubernetes cluster from the command line, you will need a configuration file containing authentication certificates and other connection information. Follow these steps to download the file to your computer or server and import it.

Download the configuration file to your computer or server:

export KUBECONFIG=pathtofile

You now need to connect to the cluster.
To check the connection to the cluster, get the cluster status information:

kubectl cluster-info

A successful connection will result in the address at which Control Plane is running:

Kubernetes control plane is running at https://XXX.XXX.XXX.XXX:YYY

To further debug and diagnose cluster problems, use 'kubectl cluster-info dump'.

If kubectl is not configured correctly or cannot connect to the Kubernetes cluster, the following message will appear in the console:
The connection to the server "xxx.xxx.xxx.xxx:yyy" was refused - did you specify the right host or port?

Use the following command to diagnose connection errors, which outputs detailed information:

kubectl cluster-info dump

You can use the Kubernetes cheat sheet to work with kubectl and become familiar with the basic Kubernetes commands.