Skip to main content
Redhat Developers  Logo
  • AI

    Get started with AI

    • Red Hat AI
      Accelerate the development and deployment of enterprise AI solutions.
    • AI learning hub
      Explore learning materials and tools, organized by task.
    • AI interactive demos
      Click through scenarios with Red Hat AI, including training LLMs and more.
    • AI/ML learning paths
      Expand your OpenShift AI knowledge using these learning resources.
    • AI quickstarts
      Focused AI use cases designed for fast deployment on Red Hat AI platforms.
    • No-cost AI training
      Foundational Red Hat AI training.

    Featured resources

    • OpenShift AI learning
    • Open source AI for developers
    • AI product application development
    • Open source-powered AI/ML for hybrid cloud
    • AI and Node.js cheat sheet

    Red Hat AI Factory with NVIDIA

    • Red Hat AI Factory with NVIDIA is a co-engineered, enterprise-grade AI solution for building, deploying, and managing AI at scale across hybrid cloud environments.
    • Explore the solution
  • Learn

    Self-guided

    • Documentation
      Find answers, get step-by-step guidance, and learn how to use Red Hat products.
    • Learning paths
      Explore curated walkthroughs for common development tasks.
    • Guided learning
      Receive custom learning paths powered by our AI assistant.
    • See all learning

    Hands-on

    • Developer Sandbox
      Spin up Red Hat's products and technologies without setup or configuration.
    • Interactive labs
      Learn by doing in these hands-on, browser-based experiences.
    • Interactive demos
      Click through product features in these guided tours.

    Browse by topic

    • AI/ML
    • Automation
    • Java
    • Kubernetes
    • Linux
    • See all topics

    Training & certifications

    • Courses and exams
    • Certifications
    • Skills assessments
    • Red Hat Academy
    • Learning subscription
    • Explore training
  • Build

    Get started

    • Red Hat build of Podman Desktop
      A downloadable, local development hub to experiment with our products and builds.
    • Developer Sandbox
      Spin up Red Hat's products and technologies without setup or configuration.

    Download products

    • Access product downloads to start building and testing right away.
    • Red Hat Enterprise Linux
    • Red Hat AI
    • Red Hat OpenShift
    • Red Hat Ansible Automation Platform
    • See all products

    Featured

    • Red Hat build of OpenJDK
    • Red Hat JBoss Enterprise Application Platform
    • Red Hat OpenShift Dev Spaces
    • Red Hat Developer Toolset

    References

    • E-books
    • Documentation
    • Cheat sheets
    • Architecture center
  • Community

    Get involved

    • Events
    • Live AI events
    • Red Hat Summit
    • Red Hat Accelerators
    • Community discussions

    Follow along

    • Articles & blogs
    • Developer newsletter
    • Videos
    • Github

    Get help

    • Customer service
    • Customer support
    • Regional contacts
    • Find a partner

    Join the Red Hat Developer program

    • Download Red Hat products and project builds, access support documentation, learning content, and more.
    • Explore the benefits

Knative Cookbook: Building Effective Serverless Applications with Kubernetes and OpenShift

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

    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

    • Protect data offloaded to GPU-accelerated environments with OpenShift sandboxed containers

    • Case study: Measuring energy efficiency on the x64 platform

    • How to prevent AI inference stack silent failures

    • Preventing GPU waste: A guide to JIT checkpointing with Kubeflow Trainer on OpenShift AI

    • How to manage TLS certificates used by OpenShift GitOps operator

    Red Hat Developers logo LinkedIn YouTube Twitter Facebook

    Platforms

    • Red Hat AI
    • Red Hat Enterprise Linux
    • Red Hat OpenShift
    • Red Hat Ansible Automation Platform
    • See all products

    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
    © 2026 Red Hat

    Red Hat legal and privacy links

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

    Chat Support

    Please log in with your Red Hat account to access chat support.