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

Backing up and restoring your K3s configurations

Backups and restoration of your Kubernetes objects are something to consider in production environments. This section explains how to perform these kinds of tasks for the default storage, SQLite, how to install and manage etcd on K3s, and basic resources if you are using the SQL backends of K3s.

Backups from SQLite

If you are using the default storage, SQLite, follow these steps:

  1. Log in to your master node:

    $ ssh ubuntu@NODE_IP
  2. Stop the K3s using the following command:

    $ k3s-killall.sh
  3. Change to the /var/lib/rancher/k3s/ directory server:

    $ sudo cd /var/lib/rancher/k3s
  4. Copy the folder server inside the k3s folder:

    $ sudo cp -R /var/lib/rancher/k3s folder_of_destination
  5. Download this folder on another device if necessary.

Backups and restoring from the SQL database K3s backend

If you are using external storage – let’s say, for example, MySQL – you have to use a tool or the command to back up your database.

Backing...