Architecture and deployment of applications with Kubernetes

When considering how to run your newly developed application, there is no getting around Kubernetes. But what exactly does that mean and what are the options for running an application in Kubernetes?

Kubernetes (K8s for short, since there are 8 letters between the "K" and the "s" of Kubernetes) was developed by Google in 2014 and released as an open source project.

It was designed to solve the problem of managing a container environment.

Kubernetes allows developers to manage and deploy their applications in a unified way, regardless of the infrastructure on which they are running.

f one decides to run one's application in Kubernetes, then one should design that application accordingly. Among other things, you should write the logs to stdout and do without configuration files. It is better to use environment variables.

Kubernetes Architecture

Kubernetes is built on the so-called master-worker principle.

Master nodes, whether one or more, are responsible for managing the worker nodes and pods in the cluster, as well as monitoring the pods, checking whether scaling tasks are necessary and whether all components are "healthy".

The worker nodes run the applications that have been deployed to the cluster.

Architektur

Advantages of Kubernetes

Kubernetes offers several advantages over traditional monolithic applications:

  • By relying on containers with Kubernetes, you need significantly fewer resources to run the application.
  • Kubernetes can take over the complete scaling of the application.
  • Because Kubernetes is completely open source, you can run it anywhere, whether in the cloud or in your own data center, whether on virtual machines or on bare metal machines.

How to deploy Kubernetes

On Prem

There are many different options in your own data center, you can use Suse Rancher or do everything yourself with Ansible. Running Kubernetes yourself involves a relatively large amount of effort, so a self-hosted Kubernetes is rarely recommended. Most likely, if there are regulatory reasons why you are not allowed to go to the cloud.

Cloud

All major cloud providers offer managed Kubernetes:

  • Google Cloud: GKE (Google Kubernetes Engine)
  • Azure: AKS (Azure Kubernetes Service)
  • AWS: EKS (Elastic Kubernetes Service)

The big advantage of a managed Kubernetes cluster is that you no longer have to worry about provisioning the nodes.

Likewise, cloud providers offer a simple tool to update the clusters. Before updating, you should use a tool such as kube-no-trouble to check whether you are using deprecated APIs that may be removed in the new version.

You book a control plane (the master node), then you have the choice which mode the worker nodes have. With AWS, for example, you can choose between EC2 and Fargate Mode.

The difference between these modes is that Fargate Mode is a serverless approach. You don't have your own servers, but your own workload runs on a shared server in the background.

EC2 mode automatically creates and terminates AWS EC2 instances on demand.

Another advantage of Managed Kubernetes is the complete integration into the cloud landscape of the respective provider. If you deploy a Kubernetes service with the type "LoadBalancer" in an EKS cluster, you get an AWS network load balancer, with the Kubernetes object Ingress you get an application load balancer.

While it is very costly to ensure high availability and reliability with a self-hosted Kubernetes cluster, you can get around this problem with cloud providers by deploying the cluster in multiple Availability Zones (AZs) in a region.

At this point, one is not yet at the end of deciding on the use of Kubernetes (pros & cons). The key is to consider how one wants to approach Kubernetes per se. Do you want to host it yourself? If not, with which cloud provider? Do you want to manage the nodes yourself or just define your resources in Kubernetes?

Personally, I can only recommend Kubernetes, as I have not experienced it before how to manage and scale a container environment so easily. Not for nothing Kubernetes is the number one container orchestration tool!

Do you guys have any experience with it? Are you satisfied or not? Feel free to contact me or ADEAL directly.
Your Pascal

Recommended

19 OCT
base image
Data analysis methodology There are many well-known methods for solving analysis problems. Why do they often not work?
26 Sep
base image
Building Customer Loyalty Loyal customers can ensure your company's constant cash flow and profitability for years to come.
14 Sep
base image
RFM Analysis – Customer Segmentation by Loyalty RFM analysis is a simple yet efficient way to predict a customer's behavior.