Serverless Architectures with Kubernetes: Create production-ready Kubernetes clusters and run serverless applications on them

This document was uploaded by one of our users. The uploader already confirmed that they had the permission to publish it. If you are author/publisher or own the copyright of this documents, please report to us by using this DMCA report form.

Simply click on the Download Book button.

Yes, Book downloads on Ebookily are 100% Free.

Sometimes the book is free on Amazon As well, so go ahead and hit "Search on Amazon"

Kubernetes has established itself as the standard platform for container management, orchestration, and deployment. By learning Kubernetes, you'll be able to design your own serverless architecture by implementing the function-as-a-service (FaaS) model. After an accelerated, hands-on overview of the serverless architecture and various Kubernetes concepts, you'll cover a wide range of real-world development challenges faced by real-world developers, and explore various techniques to overcome them. You'll learn how to create production-ready Kubernetes clusters and run serverless applications on them. You'll see how Kubernetes platforms and serverless frameworks such as Kubeless, Apache OpenWhisk and OpenFaaS provide the tooling to help you develop serverless applications on Kubernetes. You'll also learn ways to select the appropriate framework for your upcoming project. By the end of this book, you'll have the skills and confidence to design your own serverless applications using the power and flexibility of Kubernetes.

Author(s): Onur Yilmaz; Sathsara Sarathchandra
Publisher: Packt Publishing
Year: 2019

Language: English
Pages: 475

Cover
FM
Copyright
Table of Contents
Preface
Chapter 1: Introduction to Serverless
Introduction to Serverless
Serverless Origin and Manifesto
Serverless Use Cases
Serverless Architecture and Function as a Service (FaaS)
Function as a Service (FaaS)
Exercise 1: Creating an HTTP Function
Kubernetes and Serverless
Exercise 2: Packaging an HTTP Function as a Container
Exercise 3: Parameterized HTTP Functions
Activity 1: Twitter Bot Backend for Bike Points in London
Summary
Chapter 2: Introduction to Serverless in the Cloud
Introduction
Serverless and the Cloud Evaluation Criteria
AWS Lambda
Exercise 4: Creating a Function in AWS Lambda and Invoking It via the AWS Gateway API
Azure Functions
Exercise 5: Creating a Parameterized Function in Azure Functions
Google Cloud Functions
Exercise 6: Creating a Scheduled Function in GCF
Activity 2: Daily Stand-Up Meeting Reminder Function for Slack
Summary
Chapter 3: Introduction to Serverless Frameworks
Introduction
Fn Framework
Exercise 7: Getting Started with the Fn Framework
Exercise 8: Running Functions in the Fn Framework
The Serverless Framework
Exercise 9: Running Functions with the Serverless Framework
Activity 3: Daily Weather Status Function for Slack
Summary
Chapter 4: Kubernetes Deep Dive
Introduction to Kubernetes
Kubernetes Design and Components
Exercise 10: Starting a Local Kubernetes Cluster
Kubernetes Client Tool: kubectl
Exercise 11: Accessing Kubernetes Clusters Using the Client Tool: kubectl
Kubernetes Resources
Pod
Deployment
StatefulSet
Service
Job and CronJob
Exercise 12: Installing a Stateful MySQL Database and Connecting inside Kubernetes
Activity 4: Collect Gold Prices in a MySQL Database in Kubernetes
Summary
Chapter 5: Production-Ready Kubernetes Clusters
Introduction
Kubernetes Setup
Managed Platforms
Turnkey Platforms
Custom Platforms
Google Kubernetes Engine
Exercise 13: Creating a Kubernetes Cluster on GCP
Autoscaling Kubernetes Clusters
Exercise 14: Autoscaling a GKE Cluster in Production
Application Migration in Kubernetes Clusters
Exercise 15: Migrating Applications Running in a GKE Cluster
Activity 5: Minimizing the Costs of Serverless Functions in a GKE Cluster
Summary
Chapter 6: Upcoming Serverless Features in Kubernetes
Introduction to Serverless with Kubernetes
Introduction to Knative
Getting Started with Knative on GKE
Exercise 16: Deploying a Sample Application on Knative
Knative Serving Component
Canary Deployment
Exercise 17: Canary Deployment with Knative
Knative Monitoring
Knative Autoscaler
Exercise 18: Autoscaling with Knative
Google Cloud Run
Exercise 19: Deploying Containers on Google Cloud Run
Introduction to Virtual Kubelet
Exercise 20: Deploying Virtual Kubelet on AKS
Activity 6: Deploy a Containerized Application in a Serverless Environment
Summary
Chapter 7: Kubernetes Serverless with Kubeless
Introduction to Kubeless
Kubeless Architecture
Creating a Kubernetes Cluster
Creating a Kubernetes Cluster with Minikube
Installing Kubeless
Installing the Kubeless Framework
Installing the Kubeless CLI
The Kubeless UI
Kubeless Functions
Creating a Kubeless Function
Deploying the Kubeless Function
Listing the Kubeless Function
Invoking the Kubeless Function
Updating the Kubeless Function
Deleting the Kubeless Function
Exercise 21: Creating Your First Kubeless Function
Kubeless HTTP Triggers
Exercise 22: Creating an HTTP Trigger for a Kubeless Function
Kubeless PubSub Triggers
Exercise 23: Creating a PubSub Trigger for a Kubeless Function
Monitoring a Kubeless Function
Debugging a Kubeless Function
Serverless Plugin for Kubeless
Activity 7: Publishing Messages to Slack with Kubeless
Summary
Chapter 8: Introduction to Apache OpenWhisk
Introduction to OpenWhisk
Running OpenWhisk with IBM Cloud Functions
Exercise 24: Setting Up an IBM Cloud Account
Exercise 25: Installing the IBM Cloud CLI
OpenWhisk Actions
Writing Actions for OpenWhisk
Creating Actions on the OpenWhisk Framework
Listing OpenWhisk Actions
Invoking OpenWhisk Actions
Updating OpenWhisk Actions
Deleting OpenWhisk Actions
Exercise 26: Creating Your First OpenWhisk Action
OpenWhisk Sequences
Exercise 27: Creating OpenWhisk Sequences
OpenWhisk Web Actions
OpenWhisk Feeds, Triggers, and Rules
OpenWhisk CronJob Triggers
Exercise 28: Creating CronJob Triggers
OpenWhisk Packages
Exercise 29: Creating OpenWhisk Packages
Activity 8: Receive Daily Weather Updates via Email
Summary
Chapter 9: Going Serverless with OpenFaaS
Introduction to OpenFaaS
Getting Started with OpenFaas on Your Local Minikube Cluster
OpenFaaS Functions
Creating OpenFaaS Functions
Building OpenFaaS Functions
Pushing the OpenFaaS Function Image
Deploying the OpenFaaS Functions
Listing the OpenFaaS Functions
Invoking OpenFaaS Functions
Deleting OpenFaaS Functions
Exercise 30: Creating an OpenFaaS Function with Dependencies
Deploying and Invoking Functions with OpenFaaS Portal
OpenFaaS Functions with HTML Output
Exercise 31: Returning HTML Based on Path Parameters
OpenFaaS Function Observability
Exercise 32: Installing an OpenFaaS Grafana Dashboard
OpenFaaS Function Autoscaling
Activity 9: OpenFaaS Form Processor
Summary
Appendix
Index