Forwarding VMware Event Broker (VEBA) Events to Argo Workflows for Enhanced Automation
In my previous posts, I discussed the basics of onboarding in the FaaS (Function-as-a-Service) and Event-Driven worlds using VMware Event Broker (VEBA). Today, I’d like to expand on this topic by showing how you can forward VEBA events to a powerful Workflow engine named Argo to run custom workflows. This approach can be useful when the automation needs to break one or more of the FaaS best practices listed in the VEBA documentation.
To demonstrate this concept, we’ll use an OpenFaaS function called veba-to-argo-fn, which is a simple forwarder (or proxy) that executes a pre-defined Workflow Template by providing the incoming cloud-event as an input parameter of the Workflow execution. Let’s dive into the steps required to set this up:
1. Clone the repository:
First, you need to clone the following repository:
2. Copy and customize the argoconfig.example.yaml file:
Next, copy the argoconfig.example.yaml file from the repository and customize it according to your needs. This file contains the configuration for Argo, which will be used to execute the Workflows.
3. Deploy the configuration file as a new FaaS secret:
After customizing the argoconfig.example.yaml file, you need to deploy it as a new FaaS secret. This will make the configuration available to the OpenFaaS function.
4. Edit the stack.yaml file:
In the stack.yaml file, you need to pull the OpenFaaS language template for the specified language (e.g., Python or JavaScript). This will allow the OpenFaaS function to execute the Workflows.
5. Trigger the Workflow:
Now that everything is set up, you can trigger the Workflow by running the following command from the UI:
6. Test and monitor the workflow:
You can test the Workflow by running the command again with different event data. You can also monitor the progress of the Workflow in the Argo UI, which provides a quick view of the content status.
7. Re-run an existing instance of a workflow:
If you need to re-run an existing instance of a workflow (with the same inputs), you can use the following command:
8. Trigger VEBA events from your vCenter server:
Finally, you can trigger VEBA events from your vCenter server to execute the Workflows. For example, you can configure your vCenter server to send a VmCreatedEvent, VmClonedEvent, VmRegisteredEvent, DrsVmPoweredOnEvent, or VmPoweredOnEvent to the OpenFaaS function, which will then execute the appropriate Workflow based on the incoming event data.
With this setup, you can now run custom Workflows catching the event data and making multiple actions. The echoer workflow template is a simple example of what you can achieve with Argo and VEBA. The possibilities are endless, and I encourage you to test and experiment with different workflow templates to see what you can create.
Conclusion:
In this blog post, we explored how to forward VEBA events to Argo Workflows for enhanced automation. By using the veba-to-argo-fn OpenFaaS function, you can execute pre-defined Workflows based on incoming cloud-events. This approach can be useful when the automation needs to break one or more of the FaaS best practices listed in the VEBA documentation. I encourage you to test and experiment with this setup to see what you can achieve.