WilliamLam.com

  • About
    • About
    • Privacy
  • VMware Cloud
  • Tanzu
    • Application Modernization
    • Tanzu services
    • Tanzu Community Edition
    • Tanzu Kubernetes Grid
    • vSphere with Tanzu
  • Home Lab
  • Nested Virtualization
  • Apple
You are here: Home / Cloud Native / Custom webhook function to publish events into VMware Event Broker Appliance (VEBA)

Custom webhook function to publish events into VMware Event Broker Appliance (VEBA)

09.20.2021 by William Lam // Leave a Comment

In my previous article, I demonstrated how you can leverage the upcoming v0.7 release of the VMware Event Broker Appliance (VEBA) to publish and consume custom events to easily extend your event-driven automation to other event sources. As a recap, this is accomplished by constructing and sending a conformant CloudEvent to VEBA, which can then be consumed by your functions.


This is perfect for external event sources that can create a custom HTTP payload that conforms to the CloudEvent specification, however not all solutions have this type of functionality or flexibility. An alternative solution to this is to simply create a VEBA function that can accept a custom payload and then handle the transformation of the data into a valid CloudEvent and then forward that off to broker running within VEBA. This is just one of the many benefits of Knative, the backend for VEBA, where each function deployment includes an endpoint that is automatically served as a subdomain to the VEBA hostname (e.g. https://my-function.NAMESPACE.VEBA-FQDN)


This solution would enable external "Event Producer" to send a non-CloudEvent payload which can then be processed by your function and re-publish as a conformant CloudEvent that can then be consumed by other function and services.

  1. Event Provider would make HTTP request to the function webhook with a custom payload
  2. A conformant CloudEvent payload is constructed by the webhook function
  3. Webhook function will then forward the CloudEvent internally to the VMware Event Broker Appliance
  4. VEBA functions can now react to these custom CloudEvents

The only requirement to support custom webhook functions is that VEBA must be deployed with a wildcard DNS entry. This is required because each function deployment will translate into service endpoint with the following URL structure: https://[FUNCTION-NAME].[FUNCTION-NAMESPACE].[VEBA-FQDN] and your DNS server must be able to automatically resolve these dynamic endpoints.

You can view a specific function service URL by running the following command:

kubectl -n vmware-functions get ksvc [FUNCTION-NAME]


In my homelab, I am using Photon OS and Unbound for my DNS server.

Here is a typical DNS (forward and reverse record) using Unbound:

local-data: "vcenter.primp-industries.local A 192.168.30.84"
local-data-ptr: "192.168.30.84 vcenter.primp-industries.local"

Here is wildcard DNS record (which includes a forward and reverse entry) using Unbound:

local-zone: "veba.primp-industries.local." redirect
local-data: "veba.primp-industries.local. 3600 IN A 192.168.30.171"
local-data: "veba.primp-industries.local A 192.168.30.171"
local-data-ptr: "192.168.30.171 veba.primp-industries.local"

To configure wildcard DNS for your own DNS server, you should refer to the specific production documentation for guidance.

Once you have setup a wildcard DNS for your VEBA deployment, you can refer to this sample PowerShell function which demonstrates how to create and test a custom webhook function.

More from my site

  • vSphere Event-Driven Automation using VMware Event Router on VMware Cloud on AWS with Knative or AWS EventBridge
  • How to configure Knative and containerd in VMware Event Broker Appliance (VEBA) to use a private registry?
  • How to modernize your vSphere Alarm actions using the VMware Event Broker Appliance (VEBA)?
  • VMware Event Broker Appliance (VEBA) v0.6 is now available!
  • NSX Alarms in vCenter Server using vSphere Events in vSphere 8

Categories // Cloud Native, Kubernetes, vSphere Tags // Knative, VMware Event Broker Appliance, Webhook

Thanks for the comment! Cancel reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Search

Author

William Lam is a Senior Staff Solution Architect working in the VMware Cloud team within the Cloud Infrastructure Business Group (CIBG) at VMware. He focuses on Cloud Native technologies, Automation, Integration and Operation for the VMware Cloud based Software Defined Datacenters (SDDC)

Connect

  • Email
  • GitHub
  • LinkedIn
  • RSS
  • Twitter
  • Vimeo

Recent

  • How to disable the Efficiency Cores (E-cores) on an Intel NUC? 03/24/2023
  • Changing the default HTTP(s) Reverse Proxy Ports on ESXi 8.0 03/22/2023
  • NFS Multi-Connections in vSphere 8.0 Update 1 03/20/2023
  • Quick Tip - How to download ESXi ISO image for all releases including patch updates? 03/15/2023
  • SSD with multiple NVMe namespaces for VMware Homelab 03/14/2023

Advertisment

Privacy & Cookies: This site uses cookies. By continuing to use this website, you agree to their use.
To find out more, including how to control cookies, see here: Cookie Policy

Copyright WilliamLam.com © 2023

 

Loading Comments...