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
Author(s): Burr Sutter, Kamesh Sampath
Edition: 1
Publisher: O'Reilly Media
Year: 2020
Language: English
Commentary: True PDF
Pages: 160
City: Sebastopol, CA
Tags: Apache Kafka; Kubernetes; Containerization; Grafana; Prometheus; OpenShift; Serverless Applications; Knative; Istio; Jaeger; Apache Camel-K
Cover
Copyright
Table of Contents
Preface
Why We Wrote This Book
Who Should Read This Book
Conventions Used in This Book
Using Code Examples
Staying Up to Date
O’Reilly Online Learning
How to Contact Us
Acknowledgments
Reviewers
O’Reilly
From the Authors
Chapter 1. Getting Started with Knative
1.1 Installing the Required Tools
Problem
Solution
Discussion
1.2 Setting Up a Kubernetes Cluster
Problem
Solution
Discussion
1.3 Installing the Internal Kubernetes Container Registry
Problem
Solution
Discussion
1.4 Configuring Container Registry Aliases
Problem
Solution
Discussion
1.5 Installing Istio
Problem
Solution
Discussion
1.6 Installing Knative
Problem
Solution
Discussion
1.7 Verifying the Container Environment
Problem
Solution
Discussion
Creating Kubernetes Namespaces for This Book’s Recipes
Why Switch Namespaces?
Querying Kubernetes Resources
Chapter 2. Understanding Knative Serving
Knative Serving Deployment Model
Before You Begin
2.1 Deploying a Knative Service
Problem
Solution
Discussion
2.2 Updating a Knative Service Configuration
Problem
Solution
Discussion
2.3 Distributing Traffic Between Knative Service Revisions
Problem
Solution
Discussion
2.4 Applying the Blue-Green Deployment Pattern
Problem
Solution
Discussion
2.5 Applying the Canary Release Pattern
Problem
Solution
Discussion
Chapter 3. Autoscaling Knative Services
3.1 Configuring Knative Service for Autoscaling
Problem
Solution
Discussion
3.2 Observing Scale-to-Zero
Problem
Solution
Discussion
3.3 Configuring Your Knative Service to Handle Request Spikes
Problem
Solution
Discussion
3.4 Cold Start Latency
Problem
Solution
Discussion
Chapter 4. Knative Eventing
Usage Patterns
Before You Begin
4.1 Producing Events with Eventing Sources
Problem
Solution
Discussion
4.2 Receiving Events with Knative Eventing Sinks
Problem
Solution
Discussion
4.3 Deploying a Knative Eventing Service
Problem
Solution
Discussion
4.4 Connecting a Source to the Service
Problem
Solution
Discussion
4.5 Deploying an Apache Kafka Cluster
Problem
Solution
Discussion
4.6 Sourcing Apache Kafka Events with Knative Eventing
Problem
Solution
Discussion
4.7 Autoscaling with Apache Kafka and Knative Eventing
Problem
Solution
Discussion
4.8 Using a Kafka Channel as the Default Knative Channel
Problem
Solution
Discussion
4.9 Using Knative Channels and Subscriptions
Problem
Solution
Discussion
4.10 Using Knative Eventing Brokers and Triggers
Problem
Solution
Discussion
See Also
Chapter 5. Observability
5.1 Deploying Prometheus and Grafana
Problem
Solution
Discussion
5.2 Enable Prometheus for Metrics Collection
Problem
Solution
Discussion
5.3 Installing Jaeger
Problem
Solution
Discussion
5.4 Deploying Observable Test Services
Problem
Solution
Discussion
5.5 Customizing the kubectl Output Columns
Problem
Solution
Discussion
5.6 Restricting Knative Service Visibility
Problem
Solution
Discussion
Grafana Dashboards
Autoscale Debugging
5.7 Monitoring Autoscaling Metrics of a Knative Service
Problem
Solution
Discussion
5.8 Monitoring HTTP Performance Metrics of a Knative Service
Problem
Solution
Discussion
5.9 Tracing Knative Services with Jaeger
Problem
Solution
Discussion
Chapter 6. Serverless Integration Patterns Using Apache Camel-K
6.1 Installing Camel-K
Problem
Solution
Discussion
6.2 Configuring Camel-K to Build Faster
Problem
Solution
Discussion
6.3 Writing a Camel-K Integration
Problem
Solution
Discussion
6.4 Running Camel-K Integrations as Knative Serverless Services
Problem
Solution
Discussion
6.5 Using Knative Eventing with Camel-K
Problem
Solution
Discussion
6.6 Logging and Displaying CloudEvents Messages
Problem
Solution
Discussion
6.7 Wiring a CamelSource to a Knative Eventing Sink
Problem
Solution
Discussion
6.8 Applying Enterprise Integration Patterns with Camel-K
Problem
Solution
Discussion
6.9 Deploying a Data Producer
Problem
Solution
Discussion
6.10 Deploying a Data Processor
Problem
Solution
Discussion
6.11 Deploying an Event Subscriber
Problem
Solution
Discussion
6.12 Filtering Data with Knative Eventing
Problem
Solution
Discussion
Chapter 7. Knative on OpenShift
7.1 Installing Knative Serving
Problem
Solution
Discussion
7.2 Deploying a Knative Service
Problem
Solution
Discussion
7.3 Verifying and Invoking a Knative Service
Problem
Solution
Discussion
Index
About the Authors