Book Image

Edge Computing Systems with Kubernetes

By : Sergio Méndez
Book Image

Edge Computing Systems with Kubernetes

By: Sergio Méndez

Overview of this book

Edge computing is a way of processing information near the source of data instead of processing it on data centers in the cloud. In this way, edge computing can reduce latency when data is processed, improving the user experience on real-time data visualization for your applications. Using K3s, a light-weight Kubernetes and k3OS, a K3s-based Linux distribution along with other open source cloud native technologies, you can build reliable edge computing systems without spending a lot of money. In this book, you will learn how to design edge computing systems with containers and edge devices using sensors, GPS modules, WiFi, LoRa communication and so on. You will also get to grips with different use cases and examples covered in this book, how to solve common use cases for edge computing such as updating your applications using GitOps, reading data from sensors and storing it on SQL and NoSQL databases. Later chapters will show you how to connect hardware to your edge clusters, predict using machine learning, and analyze images with computer vision. All the examples and use cases in this book are designed to run on devices using 64-bit ARM processors, using Raspberry Pi devices as an example. By the end of this book, you will be able to use the content of these chapters as small pieces to create your own edge computing system.
Table of Contents (21 chapters)
1
Part 1: Edge Computing Basics
7
Part 2: Cloud Native Applications at the Edge
13
Part 3: Edge Computing Use Cases in Practice

Edge computing diagrams to build your system

Right now, with all the basic concepts of containers, orchestrators, and edge computing and its layers, we can focus on the five basic diagrams of edge computing configurations that you can use to design this kind of system. So, let’s use K3s as our main platform for edge computing for the next diagrams.

Edge cluster and public cloud

This configuration shares and processes data between the public or private cloud with edge layers, but let’s explain its different layers:

  • Cloud layer: This layer is in the public cloud and its provider, such as AWS, Azure, or GCP. This provider can offer instances using Intel or ARM processors. For example, AWS offers the AWS Graviton2 instance if you need an ARM processor. As a complement, the public cloud can offer managed services to store data such as databases, storage, and so on. The private cloud could be in this layer too. You can find software such as VMware ESXi or OpenStack to provide this kind of service or instance locally. You can even choose a hybrid approach using the public and the private cloud. In general, this layer supports your far and tiny edge layers for storage or data processing.
  • Near edge: In this layer, you can find network devices to move all the data between the cloud layer and the far layer. Typically, these include telco devices, 5G networks, and so on.
  • Far edge: In this layer, you can find K3s clusters, similar lightweight clusters such as KubeEdge, and software such as Docker or containerd. In general, this is your local processing layer.
  • Tiny edge: This is a layer inside the far edge, where you can find edge devices such as smartwatches, IoT devices, and so on, which send data to the far edge.
Figure 1.3 – Edge cluster and public cloud

Figure 1.3 – Edge cluster and public cloud

Use cases include the following:

  • Scenarios where you must share data between different systems across the internet or a private cloud
  • Distribute data processing between your cloud and the edge, such as a machine learning model generation or predictions
  • Scenarios where you must scale IoT applications, and the response time of the application is critical
  • Scenarios where you want to secure your data using the aggregation strategy of distributing data and encryption across the system

Regional edge clusters and public cloud

This configuration is focused on distributing the processing strategy across different regions and sharing data across a public cloud. Let’s explain the different layers:

  • Cloud layer: This layer contains managed services such as databases to distribute the data across different regions.
  • Near edge: In this layer, you can find network devices to move all the data between the cloud layer and the far layer. Typically, this includes telco devices, 5G networks, and so on.
  • Far edge: In this layer, you can find K3s clusters across different regions. These clusters or nodes can share or update the data stored in a public cloud.
  • Tiny edge: Here, you can find different edge devices close to each region where the far edge clusters process the information because of this distributed configuration.
Figure 1.4 – Regional edge cluster and public cloud

Figure 1.4 – Regional edge cluster and public cloud

Use cases include the following:

  • Different cluster configurations across different regions
  • Reducing application response time, choosing the closest data, or processing node location, which is critical in IoT applications
  • Sharing data across different regions
  • Distributing processing across different regions

Single node cluster and public/private cloud

This is a basic configuration where a single computer processes all the information captured on tiny edge devices. Let’s explain the different layers:

  • Cloud layer: In this layer, you can find the data storage for the system. It could be placed on the public or private cloud.
  • Near edge: In this layer, you can find network devices to move all the data between the cloud layer and the far layer. Typically, this includes telco devices, 5G networks, and so on.
  • Far edge: In this layer, you can find a single node K3s cluster that recollects data from tiny edge devices.
  • Tiny edge: Devices that capture data, such as smartwatches, tablets, cameras, sensors, and so on. This kind of configuration is more for processing locally or on a small scale.
Figure 1.5 – Single node cluster and public/private cloud

Figure 1.5 – Single node cluster and public/private cloud

Use cases include the following:

  • Low-cost and low-energy consumption environments
  • Green edge applications that can be powered by solar panels or wind turbines
  • Small processes or use cases, such as analyzing health records or autonomous house systems that need something local or not too complicated

Let’s now adapt the software to run at the edge.