Deploying Knative Components for Serverless Event Broker with VMware Event Router (Part 1)
In my previous posts, I mentioned that I prefer to reuse existing Kubernetes clusters to host the VMware Event Router and associated functions, rather than deploying the instance-based packaging of the VMware Event Broker. With the latest v0.5.0 release of the VMware Event Broker, we now have support for Knative components, which provide a new way to build, deploy, and manage modern serverless workloads. In this post, we will cover the deployment of Knative components as a preparation for the deployment of the VMware Event Brooker through Helm charts in Part 2.
Overview of Knative Components
—————————–
Knative is a Google-held Kubernetes-based platform that provides an abstraction of the messaging layer supporting multiple and pluggable event sources. The project consists of three major components:
1. Knative Eventing: Provides an abstraction of the messaging layer supporting multiple and pluggable event sources. It supports multiple delivery modes (fanout, direct) and enables a variety of usages.
2. Knative Serving: Provides middleware primitives that enable the deployment of serverless containers with automatic scaling (up and down to zero). It is in charge of traffic routing to deployed applications and managing versioning, rollbacks, load-testing, etc.
3. Kourier: A lightweight alternative for Istio ingress as its deployment consists only of an Envoy proxy and a control plane for it.
Deploying Knative Components
—————————–
To deploy Knative components, we will use the latest version of Knative, but you can change the value of the following setting according to the latest available release. The following steps assume that you already have a working Kubernetes cluster. If not, you can try kind to deploy a local, dev-purpose, cluster.
Step 1: Create a new Knative-serving namespace
——————————————–
First, we need to create a new Knative-serving namespace on the cluster with some core resources. To do this, run the following command:
“`css
kubectl create namespace knative-serving
“`
Step 2: Install and configure Kourier
————————————–
Next, we install and configure Kourier to act as our Ingress controller. Depending on the target platform you use, you may or may not have a value already set for the External-IP of the Kourier service. If you have a pending value (like in my on-premise setup), you can manually assign an IP address to the service:
“`css
kubectl expose deployment kourier –type=NodePort
“`
Step 3: Deploy Serving and Eventing components
———————————————-
Now, we deploy the Serving and Eventing components. For Serving, you can rely on the clear documentation provided by Knative to install the component. Channels are Kubernetes custom resources that define a single event forwarding and persistence layer. Here, we will only use the clusterDefault settings, but if needed, you can edit the broker configuration using the following command:
“`css
kubectl create channel –name=my-channel –broker-type=mt –cluster-default
“`
For Eventing, we can rely on the default MT Channel Based Broker, which relies on an unsuitable for production In-Memory channel. We will only use the clusterDefault settings:
“`css
kubectl create broker –name=my-broker –type=mt –cluster-default
“`
Step 4: Check running pods
—————————
As for the Serving component, you can rely on the clear documentation provided by Knative to install the Eventing component. Channels are Kubernetes custom resources that define a single event forwarding and persistence layer. Here, we will only use the clusterDefault settings, but if needed, you can edit the broker configuration using the following command:
“`css
kubectl get pods –namespace=knative-serving
“`
As shown in the above command, all running pods in the knative-serving namespace should be up and running fine.
Conclusion
———-
In this post, we covered the deployment of Knative components as a preparation for the deployment of the VMware Event Broker through Helm charts in Part 2. We discussed the overview of events within the Eventing component, the installation and configuration of Kourier as an Ingress controller, and the deployment of Serving and Eventing components. With these steps, you should now have Knative components deployed on your Kubernetes cluster, ready for the next part of the series.