Edge Computing Systems With Kubernetes
local graph
Edge Computing Systems With Kubernetes
Section titled “Edge Computing Systems With Kubernetes”chapter_01
Section titled “chapter_01”node-book_edge-computing-systems-with-kubernetes_chapter-01-edge-computing-with-kubernetes — Edge Computing with Kubernetes
chapter_02
Section titled “chapter_02”node-book_edge-computing-systems-with-kubernetes_chapter-02-k3s-installation-and-configuration — K3s Installation and Configuration
chapter_03
Section titled “chapter_03”node-book_edge-computing-systems-with-kubernetes_chapter-03-k3s-advanced-configurations-and-management — K3s Advanced Configurations and Management
chapter_04
Section titled “chapter_04”node-book_edge-computing-systems-with-kubernetes_chapter-04-k3os-installation-and-configurations — k3OS Installation and Configurations
chapter_05
Section titled “chapter_05”node-book_edge-computing-systems-with-kubernetes_chapter-05-k3s-homelab-for-edge-computing-experiments — K3s Homelab for Edge Computing Experiments
chapter_06
Section titled “chapter_06”node-book_edge-computing-systems-with-kubernetes_chapter-06-exposing-your-applications-using-ingress-controllers-and-cer — Exposing Your Applications Using Ingress Controllers and Certificates
chapter_07
Section titled “chapter_07”node-book_edge-computing-systems-with-kubernetes_chapter-07-gitops-with-flux-for-edge-applications — GitOps with Flux for Edge Applications
chapter_08
Section titled “chapter_08”node-book_edge-computing-systems-with-kubernetes_chapter-08-observability-and-traffic-splitting-using-linkerd — Observability and Traffic Splitting Using Linkerd
chapter_09
Section titled “chapter_09”node-book_edge-computing-systems-with-kubernetes_chapter-09-edge-serverless-and-event-driven-architectures-with-knative — Edge Serverless and Event-Driven Architectures with Knative and Cloud Events
chapter_10
Section titled “chapter_10”node-book_edge-computing-systems-with-kubernetes_chapter-10-sql-and-nosql-databases-at-the-edge — SQL and NoSQL Databases at the Edge
chapter_11
Section titled “chapter_11”node-book_edge-computing-systems-with-kubernetes_chapter-11-monitoring-the-edge-with-prometheus-and-grafana — Monitoring the Edge with Prometheus and Grafana
chapter_12
Section titled “chapter_12”node-book_edge-computing-systems-with-kubernetes_chapter-12-communicating-with-edge-devices-across-long-distances-using — Communicating with Edge Devices across Long Distances Using LoRa
chapter_13
Section titled “chapter_13”node-book_edge-computing-systems-with-kubernetes_chapter-13-geolocalization-applications-using-gps-nosql-and-k3s-cluster — Geolocalization Applications Using GPS, NoSQL, and K3s Clusters
chapter_14
Section titled “chapter_14”node-book_edge-computing-systems-with-kubernetes_chapter-14-computer-vision-with-python-and-k3s-clusters — Computer Vision with Python and K3s Clusters
chapter_15
Section titled “chapter_15”node-book_edge-computing-systems-with-kubernetes_chapter-15-designing-your-own-edge-computing-system — Designing Your Own Edge Computing System
Preface
Section titled “Preface”Edge computing consists of processing data near to the source where this data is generated. In order to build an edge computing system, you must understand the different layers and components that an edge system uses to process the information. Using K3s a lightweight Kubernetes, you can take advantage of the use of containers to design distributed system and automate the way that your applications are updated. This book will gives you all the necessary tools to create your own edge system across learning the basics and different use cases of edge computing. By the end of this book, you will understand how to implement your own edge computing system that uses containers with K3s for your Kubernetes clusters and cloud native open source software.
Who this book is for
Section titled “Who this book is for”This book is for operations or DevOps engineers looking to move their data processing tasks to the edge or for those engineers looking to implement an edge computing system, but they don’t have the technology background to do so. It can also be used for enthusiast and entrepreneurs looking to implement or experiment with edge computing for different or potential use case scenarios.
What this book covers
Section titled “What this book covers”Chapter 1, Edge Computing with Kubernetes, explains basic concepts of Edge Computing including its components, layers, example architectures to build these kind of systems, and showing how to use cross compiling techniques for Go, Rust, Python and Java to run software at the edge that runs on devices with ARM processors.
Chapter 2, K3s Installation and Configuration, describes what K3s is, its components, and how to install K3s using different configurations such as single and multi-node, and finally explains advanced configurations for K3s clusters to use external storages to replace the use of etcd instead, expose applications outside the cluster installing and using an ingress controller, uninstalling the cluster and some useful commands to troubleshoot cluster installations.
Chapter 3, K3s Advanced Configurations and Management, introduce the reader to advanced configurations for its K3s cluster, including the installation of MetalLB a bare metal load balancer, the installation of Longhorn for storage at the edge, upgrades in the cluster and finally backing up and restoring K3s cluster configurations.
Chapter 4, k3OS Installation and Configurations, focuses on how to use k3OS a Kubernetes distribution packaged in an ISO image that could be used to be installed on edge devices. It also covers how to use overlay on ARM devices and perform installations using config files to configure a single or multi-node K3s clusters.
Chapter 5, K3s Homelab for Edge Computing Experiments, describes how to configure your own Homelab using all the previous configurations described in the previous chapters to produce a basic production ready environment to run your edge computing applications. Starting with cluster configurations, including configurations for ingress controller, persistence for applications and how to deploy a Kubernetes dashboard for your cluster at the edge.
Chapter 6, Exposing Your Applications Using Ingress Controllers and Certificates, gives an introduction about how to configure and use the ingress controllers NGINX, Traefik and Contour together with cert-manager to expose applications running on bare metal using TLS certificates.
Chapter 7, GitOps with Flux for Edge Applications, explores how to automate edge applications updates when source code changes are detected using a GitOps strategy together with Flux and GitHub Actions.
Chapter 8, Observability and Traffic Splitting Using Linkerd, describes how to use a Service Mesh to implement simple monitoring, observability, traffic splitting, and faulty traffic to improve services availability using Linkerd running at the edge.
Chapter 9, Edge Serverless and Event-Driven Architectures with Knative and Cloud Events, gives an introduction about how to implement your own serverless functions using Knative Serving. It also shows how to implement simple event-driven architectures using Knative Eventing together with Cloud Event to define and run events in your edge systems.
Chapter 10, SQL and NoSQL Databases at the Edge, explores different type of databases that can be used to record data at the edge. This chapter covers in specific the configuration and use of MySQL, Redis, MongoDB, PostgreSQL and Neo4j to cover different use cases for SQL and NoSQL databases running at the edge.
Chapter 11, Monitoring the Edge with Prometheus and Grafana, focuses on monitoring edge environments and devices using the time series database Prometheus and Grafana. In specific, this chapter focuses on creating custom real-time graphs for data coming from edge sensors that capture temperature and humidity.
Chapter 12, Communicating with Edge Devices across Long Distances Using LoRa, describes how to communicate edge devices in long distances using LoRa wireless protocol and how to visualize captured sensors edge data using MySQL and Grafana.
Chapter 13, Geolocalization Applications Using GPS, NoSQL, and K3s Clusters, describes how to implement a simple geolocalization or geo-tracking system using GPS modules and ARM devices showing vehicles moving in real-time, and reports of their tracking logs between a date range.
Chapter 14, Computer Vision with Python and K3s Clusters, describes how to create a smart traffic system to detect potential obstacles for drivers when driving in the city and give intelligent alerts and reports of the live state of traffic during rush hours. It is also described step by step how to implement this system using Redis, OpenCV, TensorFlow Lite, Scikit Learn and GPS modules running at the edge.
Chapter 15, Designing Your Own Edge Computing System, describes a basic methodology to create your own edge computing system and how you can use cloud provider managed services, complementary hardware and software and some useful recommendations while implementing your system. Finalizing with other use cases to explore for edge computing.
To get the most out of this book
Section titled “To get the most out of this book”To feel more comfortable with this book, you need some previous experience using Linux command line, and some basic programming knowledge. When reading a chapter, pay attention to download the source code, that will simplify the use of all the examples in this book.
This book mainly uses MacOS to perform local configurations. For the Raspberry Pi implementations Linux is used. Finally, there is a chapter that uses Windows to update the ESP32 firmware.
All the requirements need it to run the examples in this book are described in the Technical requirements section of each chapter.
If you are using the digital version of this book, we advise you to type the code yourself or access the code from the book’s GitHub repository (a link is available in the next section). Doing so will help you avoid any potential errors related to the copying and pasting of code.
Conventions used
Section titled “Conventions used”There are a number of text conventions used throughout this book.
Code in text: Indicates code words in text, functions, service name, deployment names, variables, pathnames, and URLs. Here is an example: “ WIFISetUp(void): we configure the Wi-Fi connection, here you have to replace NET_NAME with your network name and PASSWORD with the password to access your connection.”
A block of code is set as follows:
@app.route('/')def hello_world(): return 'It works'Any command-line input or output is written as follows:
$ mkdir code$ kubectl apply -f example.yamlBold: Indicates a new term, an important word, or words that you see onscreen. For instance, words in menus or dialog boxes appear in bold. Here is an example: “Now create another file by clicking in File | New ”
Tips or important notes
Appear like this.