Knative Cookbook

Book description

Enterprise developers face several challenges when it comes to building serverless applications, such as integrating applications and building container images from source. With more than 60 practical recipes, this cookbook helps you solve these issues with Knative—the first serverless platform natively designed for Kubernetes. Each recipe contains detailed examples and exercises, along with a discussion of how and why it works.

If you have a good understanding of serverless computing and Kubernetes core resources such as deployment, services, routes, and replicas, the recipes in this cookbook show you how to apply Knative in real enterprise application development. Authors Kamesh Sampath and Burr Sutter include chapters on autoscaling, build and eventing, observability, Knative on OpenShift, and more.

With this cookbook, you’ll learn how to:

  • Efficiently build, deploy, and manage modern serverless workloads
  • Apply Knative in real enterprise scenarios, including advanced eventing
  • Monitor your Knative serverless applications effectively
  • Integrate Knative with CI/CD principles, such as using pipelines for faster, more successful production deployments
  • Deploy a rich ecosystem of enterprise integration patterns and connectors in Apache Camel K as Kubernetes and Knative components

Publisher resources

View/Submit Errata

Table of contents

  1. Preface
    1. Why We Wrote This Book
    2. Who Should Read This Book
    3. Conventions Used in This Book
    4. Using Code Examples
    5. Staying Up to Date
    6. O’Reilly Online Learning
    7. How to Contact Us
    8. Acknowledgments
  2. 1. Getting Started with Knative
    1. 1.1. Installing the Required Tools
    2. 1.2. Setting Up a Kubernetes Cluster
    3. 1.3. Installing the Internal Kubernetes Container Registry
    4. 1.4. Configuring Container Registry Aliases
    5. 1.5. Installing Istio
    6. 1.6. Installing Knative
    7. 1.7. Verifying the Container Environment
    8. Creating Kubernetes Namespaces for This Book’s Recipes
    9. Querying Kubernetes Resources
  3. 2. Understanding Knative Serving
    1. Knative Serving Deployment Model
    2. 2.1. Deploying a Knative Service
    3. 2.2. Updating a Knative Service Configuration
    4. 2.3. Distributing Traffic Between Knative Service Revisions
    5. 2.4. Applying the Blue-Green Deployment Pattern
    6. 2.5. Applying the Canary Release Pattern
  4. 3. Autoscaling Knative Services
    1. 3.1. Configuring Knative Service for Autoscaling
    2. 3.2. Observing Scale-to-Zero
    3. 3.3. Configuring Your Knative Service to Handle Request Spikes
    4. 3.4. Cold Start Latency
  5. 4. Knative Eventing
    1. Usage Patterns
    2. 4.1. Producing Events with Eventing Sources
    3. 4.2. Receiving Events with Knative Eventing Sinks
    4. 4.3. Deploying a Knative Eventing Service
    5. 4.4. Connecting a Source to the Service
    6. 4.5. Deploying an Apache Kafka Cluster
    7. 4.6. Sourcing Apache Kafka Events with Knative Eventing
    8. 4.7. Autoscaling with Apache Kafka and Knative Eventing
    9. 4.8. Using a Kafka Channel as the Default Knative Channel
    10. 4.9. Using Knative Channels and Subscriptions
    11. 4.10. Using Knative Eventing Brokers and Triggers
  6. 5. Observability
    1. 5.1. Deploying Prometheus and Grafana
    2. 5.2. Enable Prometheus for Metrics Collection
    3. 5.3. Installing Jaeger
    4. 5.4. Deploying Observable Test Services
    5. 5.5. Customizing the kubectl Output Columns
    6. 5.6. Restricting Knative Service Visibility
    7. Grafana Dashboards
    8. 5.7. Monitoring Autoscaling Metrics of a Knative Service
    9. 5.8. Monitoring HTTP Performance Metrics of a Knative Service
    10. 5.9. Tracing Knative Services with Jaeger
  7. 6. Serverless Integration Patterns Using Apache Camel-K
    1. 6.1. Installing Camel-K
    2. 6.2. Configuring Camel-K to Build Faster
    3. 6.3. Writing a Camel-K Integration
    4. 6.4. Running Camel-K Integrations as Knative Serverless Services
    5. 6.5. Using Knative Eventing with Camel-K
    6. 6.6. Logging and Displaying CloudEvents Messages
    7. 6.7. Wiring a CamelSource to a Knative Eventing Sink
    8. 6.8. Applying Enterprise Integration Patterns with Camel-K
    9. 6.9. Deploying a Data Producer
    10. 6.10. Deploying a Data Processor
    11. 6.11. Deploying an Event Subscriber
    12. 6.12. Filtering Data with Knative Eventing
  8. 7. Knative on OpenShift
    1. 7.1. Installing Knative Serving
    2. 7.2. Deploying a Knative Service
    3. 7.3. Verifying and Invoking a Knative Service
  9. Index

Product information

  • Title: Knative Cookbook
  • Author(s): Burr Sutter, Kamesh Sampath
  • Release date: April 2020
  • Publisher(s): O'Reilly Media, Inc.
  • ISBN: 9781492061199