Book Image

IoT Edge Computing with MicroK8s

By : Karthikeyan Shanmugam
Book Image

IoT Edge Computing with MicroK8s

By: Karthikeyan Shanmugam

Overview of this book

Are you facing challenges with developing, deploying, monitoring, clustering, storing, securing, and managing Kubernetes in production environments as you're not familiar with infrastructure technologies? MicroK8s - a zero-ops, lightweight, and CNCF-compliant Kubernetes with a small footprint is the apt solution for you. This book gets you up and running with production-grade, highly available (HA) Kubernetes clusters on MicroK8s using best practices and examples based on IoT and edge computing. Beginning with an introduction to Kubernetes, MicroK8s, and IoT and edge computing architectures, this book shows you how to install, deploy sample apps, and enable add-ons (like DNS and dashboard) on the MicroK8s platform. You’ll work with multi-node Kubernetes clusters on Raspberry Pi and networking plugins (such as Calico and Cilium) and implement service mesh, load balancing with MetalLB and Ingress, and AI/ML workloads on MicroK8s. You’ll also understand how to secure containers, monitor infrastructure and apps with Prometheus, Grafana, and the ELK stack, manage storage replication with OpenEBS, resist component failure using a HA cluster, and more, as well as take a sneak peek into future trends. By the end of this book, you’ll be able to use MicroK8 to build and implement scenarios for IoT and edge computing workloads in a production environment.
Table of Contents (24 chapters)
1
Part 1: Foundations of Kubernetes and MicroK8s
4
Part 2: Kubernetes as the Preferred Platform for IOT and Edge Computing
7
Part 3: Running Applications on MicroK8s
14
Part 4: Deploying and Managing Applications on MicroK8s
21
Frequently Asked Questions About MicroK8s

What this book covers

Chapter 1, Getting Started with Kubernetes, introduces Kubernetes and the various components of the Kubernetes system as well as the abstractions.

Chapter 2, Introducing MicroK8s, introduces MicroK8s and shows how to install it, how to verify its installation status, and how to monitor and manage a Kubernetes cluster. We will also learn how to use some of the add-ons and deploy a sample application.

Chapter 3, Essentials of IoT and Edge Computing, delves into how Kubernetes, edge computing, and the cloud can collaborate to drive intelligent business decisions. This chapter gives an overview of the Internet of Things (IoT), the Edge, and how they are related, as well as the advantages of edge computing.

Chapter 4, Handling the Kubernetes Platform for IoT and Edge Computing, examines how Kubernetes for edge computing offers a compelling value proposition and different architectural approaches that demonstrate how Kubernetes can be used for edge workloads, as well as support for architecture that meets an enterprise application’s requirements – low latency, resource-constrained, data privacy, and bandwidth scalability.

Chapter 5, Creating and Implementing on Updates Multi-Node Raspberry Pi Kubernetes Clusters, explores how to set up a MicroK8s Raspberry Pi multi-node cluster, deploy a sample application, and execute rolling updates on the deployed application. We will also understand ways to scale the deployed application. We will also touch upon some of the recommended practices for building a scalable, secure, and highly optimized Kubernetes cluster model.

Chapter 6, Configuring Connectivity for Containers, looks at how networking is handled in a Kubernetes cluster. Furthermore, we will understand how to use Calico, Cilium, and Flannel CNI plugins to network the cluster. We will go through the most important factors to consider when choosing a CNI service.

Chapter 7, Setting Up MetalLB and Ingress for Load Balancing, delves into techniques (MetalLB and Ingress) for exposing services outside a cluster.

Chapter 8, Monitoring the Health of Infrastructure and Applications, examines various choices for monitoring, logging, and alerting your cluster, and provides detailed steps on how to configure them. We will also go through the essential metrics that should be watched in order to successfully manage your infrastructure and apps.

Chapter 9, Using Kubeflow to Run AI/MLOps Workloads, covers how to develop and deploy a sample ML model using the Kubeflow ML platform. We will also go through some of the best practices for running AI/ML workloads on Kubernetes.

Chapter 10, Going Serverless with Knative and OpenFaaS Frameworks, examines two of the most popular serverless frameworks included with MicroK8s, Knative and OpenFaaS, both of which are Kubernetes-based platforms for developing, deploying, and managing modern serverless workloads. We will also go through the best practices for developing and deploying serverless applications.

Chapter 11, Managing Storage Replication with OpenEBS, looks at how to use OpenEBS to implement storage replication that synchronizes data across several nodes. We will go through the steps involved in configuring and implementing a PostgreSQL stateful application utilizing the OpenEBS Jiva storage engine. We will also look at the Kubernetes storage best practices as well as recommendations for data engines.

Chapter 12, Implementing Service Mesh for Cross-Cutting Concerns, walks you through the steps of deploying Istio and Linkerd service meshes. You will also learn how to deploy and run a sample application, as well as how to configure and access dashboards.

Chapter 13, Resting Component Failure Using HA Clusters, walks you through the steps involved in setting up a highly available cluster that can withstand a component failure and continue to serve workloads without interruption. We will also discuss some of the best practices for implementing Kubernetes applications on your production-ready cluster.

Chapter 14, Hardware Virtualization for Securing Containers, looks at how to use Kata Containers, a secure container runtime, to provide stronger workload isolation, leveraging hardware virtualization technology. We also discuss the best practices for establishing container security on your production-grade cluster.

Chapter 15, Implementing Strict Confinement for Isolated Containers, shows you how to install the MicroK8s snap with a strict confinement option, monitor the installation’s progress, and manage a Kubernetes cluster running on Ubuntu Core. We will also deploy a sample application and examine whether the application is able to run on a strict confinement-enabled Kubernetes cluster.

Chapter 16, Diving into the Future, looks at how Kubernetes and MicroK8s are uniquely positioned for accelerating IoT and edge deployments, and also the key trends that are shaping our new future.

Frequently Asked Questions About MicroK8s