Skip to main content
Redhat Developers  Logo
  • Products

    Featured

    • Red Hat Enterprise Linux
      Red Hat Enterprise Linux Icon
    • Red Hat OpenShift AI
      Red Hat OpenShift AI
    • Red Hat Enterprise Linux AI
      Linux icon inside of a brain
    • Image mode for Red Hat Enterprise Linux
      RHEL image mode
    • Red Hat OpenShift
      Openshift icon
    • Red Hat Ansible Automation Platform
      Ansible icon
    • Red Hat Developer Hub
      Developer Hub
    • View All Red Hat Products
    • Linux

      • Red Hat Enterprise Linux
      • Image mode for Red Hat Enterprise Linux
      • Red Hat Universal Base Images (UBI)
    • Java runtimes & frameworks

      • JBoss Enterprise Application Platform
      • Red Hat build of OpenJDK
    • Kubernetes

      • Red Hat OpenShift
      • Microsoft Azure Red Hat OpenShift
      • Red Hat OpenShift Virtualization
      • Red Hat OpenShift Lightspeed
    • Integration & App Connectivity

      • Red Hat Build of Apache Camel
      • Red Hat Service Interconnect
      • Red Hat Connectivity Link
    • AI/ML

      • Red Hat OpenShift AI
      • Red Hat Enterprise Linux AI
    • Automation

      • Red Hat Ansible Automation Platform
      • Red Hat Ansible Lightspeed
    • Developer tools

      • Red Hat Trusted Software Supply Chain
      • Podman Desktop
      • Red Hat OpenShift Dev Spaces
    • Developer Sandbox

      Developer Sandbox
      Try Red Hat products and technologies without setup or configuration fees for 30 days with this shared Openshift and Kubernetes cluster.
    • Try at no cost
  • Technologies

    Featured

    • AI/ML
      AI/ML Icon
    • Linux
      Linux Icon
    • Kubernetes
      Cloud icon
    • Automation
      Automation Icon showing arrows moving in a circle around a gear
    • View All Technologies
    • Programming Languages & Frameworks

      • Java
      • Python
      • JavaScript
    • System Design & Architecture

      • Red Hat architecture and design patterns
      • Microservices
      • Event-Driven Architecture
      • Databases
    • Developer Productivity

      • Developer productivity
      • Developer Tools
      • GitOps
    • Secure Development & Architectures

      • Security
      • Secure coding
    • Platform Engineering

      • DevOps
      • DevSecOps
      • Ansible automation for applications and services
    • Automated Data Processing

      • AI/ML
      • Data Science
      • Apache Kafka on Kubernetes
      • View All Technologies
    • Start exploring in the Developer Sandbox for free

      sandbox graphic
      Try Red Hat's products and technologies without setup or configuration.
    • Try at no cost
  • Learn

    Featured

    • Kubernetes & Cloud Native
      Openshift icon
    • Linux
      Rhel icon
    • Automation
      Ansible cloud icon
    • Java
      Java icon
    • AI/ML
      AI/ML Icon
    • View All Learning Resources

    E-Books

    • GitOps Cookbook
    • Podman in Action
    • Kubernetes Operators
    • The Path to GitOps
    • View All E-books

    Cheat Sheets

    • Linux Commands
    • Bash Commands
    • Git
    • systemd Commands
    • View All Cheat Sheets

    Documentation

    • API Catalog
    • Product Documentation
    • Legacy Documentation
    • Red Hat Learning

      Learning image
      Boost your technical skills to expert-level with the help of interactive lessons offered by various Red Hat Learning programs.
    • Explore Red Hat Learning
  • Developer Sandbox

    Developer Sandbox

    • Access Red Hat’s products and technologies without setup or configuration, and start developing quicker than ever before with our new, no-cost sandbox environments.
    • Explore Developer Sandbox

    Featured Developer Sandbox activities

    • Get started with your Developer Sandbox
    • OpenShift virtualization and application modernization using the Developer Sandbox
    • Explore all Developer Sandbox activities

    Ready to start developing apps?

    • Try at no cost
  • Blog
  • Events
  • Videos

Knative Cookbook: Building Effective Serverless Applications with Kubernetes and OpenShift

April 23, 2020
Kamesh Sampath Burr Sutter
Related topics:
MicroservicesServerlessKubernetesEvent-Driven

Share:

    Serverless architecture has recently taken center stage in cloud-native application deployment: Enterprises started to see the benefits that serverless applications bring to them, such as agility, rapid deployment, and resource cost optimization. As with any other new technology, there were multiple ways to approach and employ serverless technologies, such as Function-as-a-Service (FaaS) and Backend-as-a-Service (BaaS)—that is, running your applications as ephemeral containers—with the ability to scale up and down automatically.

    Knative Cookbook front and back cover

    Knative was started with the simple goal of having a Kubernetes-native platform to build, deploy, and manage your serverless workloads. Kubernetes solves a lot of cloud-native application problems, but with a fair bit of complexity, especially from the perspective of deployment. To make a simple service deployment with Kubernetes, a developer has to write a minimum of two YAMLs (such as a Deployment service) and then perform the necessary plumbing work to expose the service to the outside world. This complexity causes an application developer to spend more time crafting the YAMLs and other core platform tasks rather than focusing on the business need.

    Let me explain this issue with an example. Say that I want to deploy a hello world kind of application and expose the service. First, I need to create a deployment, so here I created a deployment called myboot:

    No video provider was found to handle the given URL. See the documentation for more information.

    Next, I need to expose this deployment as a service named myboot (for example, an Application-as-a-Service):

    https://gist.github.com/kameshsampath/1bd96f24e25371f280863ee8522fdab9

    But wait, do I need to write these elaborate YAMLs every time I want to deploy my application as a service? Unfortunately, I did, until Knative was born. Knative solves these Kubernetes problems by providing all essential middleware primitives via a simpler deployment model. On Knative you can deploy any modern application workload, such as monolithic applications, microservices, or even tiny functions. Knative can run in any cloud platform that runs Kubernetes, which gives enterprises more agility and flexibility in running their serverless workloads without relying on cloud vendor-specific features.

    Let me show you how simpler your deployment is when you deploy the same myboot as a Knative service:

    https://gist.github.com/kameshsampath/a28fe7848c89f655a3b7c611979dae27

    Though the simpler deployment model is a key feature offered by Knative, there is much more to Knative than that. This is where we—as part of the Red Hat Developer Program—thought it would be awesome to help developers dive into Knative quickly and easily, which gave birth to the Knative Tutorial. This tutorial not only provides the getting started experience for Knative but also prepares you for the next level.

    The fact there are many ways to do serverless has resulted in confusion among developers, with the following questions being raised immediately:

    • What implementation should I choose: FaaS or BaaS?
    • What is the quickest way to get started?
    • What are the use cases for which I can apply serverless technology?
    • How do I measure the benefits?
    • What tools I should use to develop serverless applications?

    We had the same set of questions when we started to explore serverless technology as part of writing the Knative Tutorial. The problems and challenges that we faced during our research became the crux of the Knative cookbook. 

    As the Knative project picked up momentum, it became obvious that there should be a guide book that could provide practical applications of Knative and typical how-to scenarios. Seeing this need is what caused Burr Sutter and me to create the Knative Cookbook, which covers the following topics:

    • Installing Knative into your Kubernetes cluster.
    • Auto-scaling to zero.
    • Scaling up to handle request spikes.
    • Responding to external event stimuli in a serverless way.
    • Using Apache Kafka with Knative Eventing.
    • Using Kubernetes, Knative, Kafka, and Kamel for 4K cloud-native computing.

    Download the Knative Cookbook here, and we hope that this ebook will be of great assistance on your Knative journey!

    Last updated: June 29, 2020

    Recent Posts

    • Create and enrich ServiceNow ITSM tickets with Ansible Automation Platform

    • Expand Model-as-a-Service for secure enterprise AI

    • OpenShift LACP bonding performance expectations

    • Build container images in CI/CD with Tekton and Buildpacks

    • How to deploy OpenShift AI & Service Mesh 3 on one cluster

    Red Hat Developers logo LinkedIn YouTube Twitter Facebook

    Products

    • Red Hat Enterprise Linux
    • Red Hat OpenShift
    • Red Hat Ansible Automation Platform

    Build

    • Developer Sandbox
    • Developer Tools
    • Interactive Tutorials
    • API Catalog

    Quicklinks

    • Learning Resources
    • E-books
    • Cheat Sheets
    • Blog
    • Events
    • Newsletter

    Communicate

    • About us
    • Contact sales
    • Find a partner
    • Report a website issue
    • Site Status Dashboard
    • Report a security problem

    RED HAT DEVELOPER

    Build here. Go anywhere.

    We serve the builders. The problem solvers who create careers with code.

    Join us if you’re a developer, software engineer, web designer, front-end designer, UX designer, computer scientist, architect, tester, product manager, project manager or team lead.

    Sign me up

    Red Hat legal and privacy links

    • About Red Hat
    • Jobs
    • Events
    • Locations
    • Contact Red Hat
    • Red Hat Blog
    • Inclusion at Red Hat
    • Cool Stuff Store
    • Red Hat Summit
    © 2025 Red Hat

    Red Hat legal and privacy links

    • Privacy statement
    • Terms of use
    • All policies and guidelines
    • Digital accessibility

    Report a website issue