O'Reilly logo

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Kubernetes for Serverless Applications

Book Description

Transform yourself into a Kubernetes specialist in serverless applications.

About This Book

  • Get hands-on experience in installing, configuring, and using services such as Kubeless, Funktion, OpenWhisk, and Fission
  • Learn how to launch Kubernetes both locally and in public clouds
  • Explore the differences between using services such as AWS Lambda and Azure Functions and running your own

Who This Book Is For

If you are a DevOps engineer, cloud architect, or a stakeholder keen to learn about serverless functions in Kubernetes environments, then this book is for you.

What You Will Learn

  • Get a detailed analysis of serverless/Functions as a Service
  • Get hands-on with installing and running tasks in Kubernetes using Minikube
  • Install Kubeless locally and launch your first function.
  • Launch Kubernetes in the cloud and move your applications between your local machine and your cloud cluster
  • Deploy applications on Kubernetes using Apache OpenWhisk
  • Explore topics such as Funktion and Fission installation on the cloud followed by launching applications
  • Monitor a serverless function and master security best practices and Kubernetes use cases

In Detail

Kubernetes has established itself as the standard platform for container management, orchestration, and deployment. It has been adopted by companies such as Google, its original developers, and Microsoft as an integral part of their public cloud platforms, so that you can develop for Kubernetes and not worry about being locked into a single vendor.

This book will initially start by introducing serverless functions. Then you will configure tools such as Minikube to run Kubernetes. Once you are up-and-running, you will install and configure Kubeless, your first step towards running Function as a Service (FaaS) on Kubernetes. Then you will gradually move towards running Fission, a framework used for managing serverless functions on Kubernetes environments. Towards the end of the book, you will also work with Kubernetes functions on public and private clouds.

By the end of this book, we will have mastered using Function as a Service on Kubernetes environments.

Style and approach

A clear, concise, and straightforward book that will empower you work with clusters and run serverless functions effectively.

Table of Contents

  1. Preface
    1. Who this book is for
    2. What this book covers
    3. To get the most out of this book
      1. Download the example code files
      2. Download the color images
      3. Conventions used
    4. Get in touch
      1. Reviews
  2. The Serverless Landscape
    1. Serverless and Functions as a Service
      1. Pets, cattle, chickens, insects, and snowflakes
        1. Pets
        2. Cattle
        3. Chickens
        4. Insects
        5. Snowflakes
        6. Summing up
      2. Serverless and insects
    2. Public cloud offerings
      1. AWS Lambda
        1. Prerequisites 
        2. Creating a Lambda function
      2. Microsoft Azure Functions
        1. Prerequisites 
        2. Creating a Function app
    3. The serverless toolkit
    4. Problems solved by serverless and Functions as a Service
    5. Summary
  3. An Introduction to Kubernetes
    1. A brief history of Kubernetes
      1. Control groups
      2. lmctfy
      3. Borg
      4. Project Seven 
    2. An overview of Kubernetes
      1. Components
      2. Pods and services
      3. Workloads
        1. ReplicaSet
        2. Deployments
        3. StatefulSets
    3. Kubernetes use cases
    4. References
    5. Summary
  4. Installing Kubernetes Locally
    1. About Minikube
    2. Installing Minikube
      1. macOS 10.13 High Sierra
      2. Windows 10 Professional
      3. Ubuntu 17.04
      4. Hypervisors
      5. Starting Minikube
    3. Minikube commands
      1. Stop and delete
      2. Environment
      3. Virtual machine access and logs
    4. Hello world
      1. The dashboard
      2. The command line
    5. References
    6. Summary
  5. Introducing Kubeless Functioning
    1. Installing Kubeless
      1. The Kubeless Kubernetes cluster
      2. The command-line client
        1. macOS 10.13 High Sierra
        2. Windows 10 Professional
        3. Ubuntu 17.04
      3. The Kubeless web interface
    2. Kubeless overview
      1. So what is Kubeless?
      2. Who made Kubeless?
      3. Kubeless commands
    3. Hello world
      1. The basic example
      2. An example of reading data
    4. Twitter example
      1. The Twitter API
      2. Adding secrets to Kubernetes
      3. The Twitter function
    5. The Kubeless serverless plugin
    6. Summary
  6. Using Funktion for Serverless Applications
    1. Introducing Funktion
    2. Installing and configuring Funktion
      1. The command-line client
        1. macOS 10.13 High Sierra
        2. Windows 10 Professional
        3. Ubuntu 17.04
      2. Launching a single-node Kubernetes cluster
      3. Bootstrapping Funktion
    3. Deploying a simple function
    4. Twitter streams
    5. Summary
  7. Installing Kubernetes in the Cloud
    1. Launching Kubernetes in DigitalOcean
      1. Creating Droplets
      2. Deploying Kubernetes using kubeadm
      3. Removing the cluster
    2. Launching Kubernetes in AWS
      1. Getting set up
      2. Launching the cluster using kube-aws
      3. The Sock Shop
      4. Removing the cluster
    3. Launching Kubernetes in Microsoft Azure
      1. Preparing the Azure command-line tools
      2. Launching the AKS cluster
      3. The Sock Shop
      4. Removing the cluster
    4. Launching Kubernetes on the Google Cloud Platform
      1. Installing the command-line tools
      2. Launching the Google container cluster
      3. The Sock Shop
      4. Running Kubeless
      5. Removing the cluster
    5. Summary
  8. Apache OpenWhisk and Kubernetes
    1. Apache OpenWhisk overview
    2. Running Apache OpenWhisk locally
      1. Installing Vagrant
      2. Downloading and configuring Apache OpenWhisk
      3. Installing the Apache OpenWhisk client
      4. Hello world
    3. Running Apache OpenWhisk on Kubernetes
      1. Deploying OpenWhisk
        1. CouchDB
        2. Redis
        3. API Gateway
        4. ZooKeeper
        5. Kafka
        6. Controller
        7. Invoker
        8. NGINX
      2. Configuring OpenWhisk
      3. Hello world
    4. Summary
  9. Launching Applications Using Fission
    1. Fission overview
    2. Installing the prerequisites 
      1. Installing Helm
      2. Installing the Fission CLI
    3. Running Fission locally
      1. Launching Fission using Helm
      2. Working through the output
      3. Launching our first function
      4. A guestbook
    4. Fission commands
      1. The fission function command
        1. The create command
        2. The get option
        3. The list and getmeta commands
        4. The logs command
        5. The update command
        6. The delete command
      2. The fission environment command
        1. The create command
        2. The list and get command
        3. The delete command
    5. Running Fission in the cloud
      1. Launching the Kubernetes cluster
      2. Installing Fission
      3. The guestbook
    6. Some more examples
      1. Weather
      2. Slack
      3. Whales
    7. Summary
  10. Looking at OpenFaaS
    1. An introduction to OpenFaaS
    2. Running OpenFaaS locally
      1. The OpenFaaS command-line client
      2. Docker
      3. Starting the Minikube cluster
      4. Installing OpenFaaS using Helm
      5. Hello world!
      6. The OpenFaaS UI and store
      7. Prometheus
    3. Summary
  11. Serverless Considerations
    1. Security best practices
      1. Securing Kubernetes
      2. Securing serverless services
        1. OpenFaaS
        2. Kubeless
        3. Funktion
        4. Apache OpenWhisk
        5. Fission
        6. Conclusions
    2. Monitoring Kubernetes
      1. The dashboard
      2. Google Cloud
      3. Microsoft Azure
    3. Summary
  12. Running Serverless Workloads
    1. Evolving software and platforms
      1. Kubernetes
      2. Serverless tools
        1. Kubeless
        2. Apache OpenWhisk
        3. Fission
        4. OpenFaaS
        5. Funktion
      3. Future developments
    2. Why Functions as a Service on Kubernetes
    3. Fixed points
      1. Databases
      2. Storage
    4. Summary
  13. Other Books You May Enjoy
    1. Leave a review - let other readers know what you think