---
title: "How to Enable Serverless Computing in Kubernetes"
source: "https://www.tigera.io/blog/how-to-enable-serverless-computing-in-kubernetes/"
---

[Technical Blog](https://www.tigera.io/category/technical-blog/)

# How to Enable Serverless Computing in Kubernetes

By [Daniel Oh](https://www.tigera.io/blog/author/daniel-oh/) on Aug 01, 2019 • 5 min read

In the first two articles in this series about using serverless on an open source platform, I described [how to get started with serverless platforms](http://opensource.com/article/18/11/open-source-serverless-platforms) and [how to write functions](http://opensource.com/article/18/11/developing-functions-service-apache-openwhisk) in popular languages and build components using containers on Apache OpenWhisk.

Here in the third article, I’ll walk you through enabling serverless in your [Kubernetes](http://kubernetes.io/) environment. Kubernetes is the most popular platform to manage serverless workloads and microservice application containers and uses a finely grained deployment model to process workloads more quickly and easily.

## Serverless Computing in Kubernetes

Keep in mind that serverless not only helps you reduce infrastructure management while utilizing a consumption model for actual service use but also provides many capabilities of what the cloud platform serves. There are many serverless or FaaS (Function as a Service) platforms, but Kuberenetes is the first-class citizen for building a serverless platform because there are more than [13 serverless or FaaS open source projects](http://landscape.cncf.io/format=serverless) based on Kubernetes.

However, Kubernetes won’t allow you to build, serve, and manage app containers for your serverless workloads in a native way. For example, if you want to build a [CI/CD pipeline](http://opensource.com/article/18/8/what-cicd) on Kubernetes to build, test, and deploy cloud-native apps from source code, you need to use your own release management tool and integrate it with Kubernetes.

Likewise, it’s difficult to use Kubernetes in combination with serverless computing unless you use an independent serverless or FaaS platform built on Kubernetes, such as [Apache OpenWhisk](http://openwhisk.apache.org/), [Riff](http://projectriff.io/), or [Kubeless](http://kubeless.io/). More importantly, the Kubernetes environment is still difficult for developers to learn the features of how it deals with serverless workloads from cloud-native apps.

## Knative

[Knative](http://cloud.google.com/knative/) was born for developers to create serverless experiences natively without depending on extra serverless or FaaS frameworks and many custom tools. Knative has three primary components—[Build](http://github.com/knative/build), [Serving](http://github.com/knative/serving), and [Eventing](http://github.com/knative/eventing)—for addressing common patterns and best practices for developing serverless applications on Kubernetes platforms.

To learn more, let’s go through the usual development process for using Knative to increase productivity and solve Kubernetes’ difficulties from the developer’s point of view.

### **Step 1:**

Generate your cloud-native application from scratch using [Spring Initializr](http://start.spring.io/)or [Thorntail Project Generator](http://thorntail.io/generator/). Begin implementing your business logic using the [12-factor app methodology](http://12factor.net/), and you might also do assembly testing to see if the function works correctly in many local testing tools.

![No alt text provided for this image](/app/uploads/2019/06/0-2.png)

![No alt text provided for this image](/app/uploads/2019/06/0-1.png)

 

### **Step 2:**

Build container images from your source code repositories via the Knative Build component. You can define multiple steps, such as installing dependencies, running integration testing, and pushing container images to your secured image registry for using existing Kubernetes primitives. More importantly, Knative Build makes developers’ daily work easier and simpler—”boring but difficult.” Here’s an example of the Build YAML:

```
`apiVersion: build.knative.dev/v1alpha1 kind: Build metadata: name: docker-build spec: serviceAccountName: build-bot source: git: revision: master url: http://github.com/redhat-developer-demos/knative-tutorial-event-greeter.git steps: - args: - --context=/workspace/java/springboot - --dockerfile=/workspace/java/springboot/Dockerfile - --destination=docker.io/demo/event-greeter:0.0.1 env: - name: DOCKER_CONFIG value: /builder/home/.docker image: gcr.io/kaniko-project/executor name: docker-push`
```

 

### **Step 3:**

Deploy and serve your container applications as serverless workloads via the Knative Serving component. This step shows the beauty of Knative in terms of automatically scaling up your serverless containers on Kubernetes then scaling them down to zero if there is no request to the containers for a specific period (e.g., two minutes). More importantly, [Istio](http://istio.io/) will automatically address ingress and egress networking traffic of serverless workloads in multiple, secure ways. Here’s an example of the Serving YAML:

```
`apiVersion: serving.knative.dev/v1alpha1 kind: Service metadata: name: greeter spec: runLatest: configuration: revisionTemplate: spec: container: image: dev.local/rhdevelopers/greeter:0.0.1`
```

 

### **Step 4:**

Bind running serverless containers to a variety of eventing platforms, such as SaaS, FaaS, and Kubernetes, via Knative’s Eventing component. In this step, you can define event channels and subscriptions, which are delivered to your services via a messaging platform such as [Apache Kafka](http://kafka.apache.org/) or [NATS streaming](http://nats.io/). Here’s an example of the Event sourcing YAML:

```
`apiVersion: sources.eventing.knative.dev/v1alpha1 kind: CronJobSource metadata: name: test-cronjob-source spec: schedule: "* * * * *" data: '{"message": "Event sourcing!!!!"}' sink: apiVersion: eventing.knative.dev/v1alpha1 kind: Channel name: ch-event-greeter`
```

 

## Conclusion

Developing with Knative will save a lot of time in building serverless applications in the Kubernetes environment. It can also make developers’ jobs easier by focusing on developing serverless applications, functions, or cloud-native containers.

This article is published originally by myself at [http://opensource.com/article/19/4/enabling-serverless-kubernetes](http://opensource.com/article/19/4/enabling-serverless-kubernetes)

This article originated from [http://www.linkedin.com/pulse/how-enable-serverless-computing-kubernetes-daniel-oh/](http://www.linkedin.com/pulse/how-enable-serverless-computing-kubernetes-daniel-oh/)

[Daniel Oh](http://kr.linkedin.com/in/daniel-oh-083818112) works as a principal technical product marketing manager at Red Hat as well as CNCF ambassador to encourage developers’ participation of cloud-native app development at scale and speed.

————————————————-

[**Free Online Training**](https://www.tigera.io/events/)

Access Live and On-Demand Kubernetes Tutorials

[**Calico Enterprise – Free Trial**](https://www.calicocloud.io/home)

Solve Common Kubernetes Roadblocks and Advance Your Enterprise Adoption

[How-To](https://www.tigera.io/tags/how-to/)

## Related posts

[![Save the Address, Save the Cloud: A Hands-on KubeVirt Live Migration Workshop](https://www.tigera.io/app/uploads/2026/07/Save-the-Address-Save-the-Cloud-A-Hands-on-KubeVirt-Live-Migration-Workshop.png)](https://www.tigera.io/blog/save-the-address-save-the-cloud-a-hands-on-kubevirt-live-migration-workshop/)

#### [Save the Address, Save the Cloud: A Hands-on KubeVirt Live Migration Workshop](https://www.tigera.io/blog/save-the-address-save-the-cloud-a-hands-on-kubevirt-live-migration-workshop/)

By [Reza Ramezanpour](https://www.tigera.io/blog/author/rezar/)
on Jul 9, 2026

In the previous post in this series, we covered why Virtual Machine (VM) Live Migration in Kubernetes is difficult: a VM’s IP is its identity, and the “new” VM on the destination node has to...

[Read more](https://www.tigera.io/blog/save-the-address-save-the-cloud-a-hands-on-kubevirt-live-migration-workshop/)

[![KubeVirt Networking: How to Preserve VM IP Addresses During Migration](https://www.tigera.io/app/uploads/2026/04/KubeVirt-Networking-How-to-Preserve-VM-IP-Addresses-During-Migration-1-1.png)](https://www.tigera.io/blog/kubevirt-networking-how-to-preserve-vm-ip-addresses-during-migration/)

#### [KubeVirt Networking: How to Preserve VM IP Addresses During Migration](https://www.tigera.io/blog/kubevirt-networking-how-to-preserve-vm-ip-addresses-during-migration/)

By [Dillon Barry](https://www.tigera.io/blog/author/dillon-barry/)
on Apr 21, 2026

Organisations are re-evaluating their VM infrastructure. The economics have shifted, the tooling has matured, and the case for running two separate platforms, one for containers, one for VMs, is getting harder to justify. Platform teams...

[Read more](https://www.tigera.io/blog/kubevirt-networking-how-to-preserve-vm-ip-addresses-during-migration/)

[![How to Stub LLMs for AI Agent Security Testing and Governance](https://www.tigera.io/app/uploads/2026/04/How-to-Stub-LLMs-for-AI-Agent-Security-Testing-and-Governance.png)](https://www.tigera.io/blog/how-to-stub-llms-for-ai-agent-security-testing-and-governance/)

#### [How to Stub LLMs for AI Agent Security Testing and Governance](https://www.tigera.io/blog/how-to-stub-llms-for-ai-agent-security-testing-and-governance/)

By [Alister Baroi](https://www.tigera.io/blog/author/alister-baroi/)
on Apr 2, 2026

Note: The core architecture for this pattern was introduced by Isaac Hawley from Tigera. If you are building an AI agent that relies on tool calling, complex routing, or the Model Context Protocol (MCP), you’re...

[Read more](https://www.tigera.io/blog/how-to-stub-llms-for-ai-agent-security-testing-and-governance/)

<!-- plugin=object-cache-pro client=phpredis metric#hits=3187 metric#misses=33 metric#hit-ratio=99.0 metric#bytes=1569548 metric#prefetches=0 metric#store-reads=176 metric#store-writes=13 metric#store-hits=170 metric#store-misses=22 metric#sql-queries=31 metric#ms-total=481.93 metric#ms-cache=25.09 metric#ms-cache-avg=0.1335 metric#ms-cache-ratio=5.2 -->
