Experiment with Argo Event and Argo Workflow, and execute several examples.
Info
This article was originally written in Korean and has been translated using ChatGPT.
Introduction
In Kubernetes, batch-type applications are catered for.
They can be executed as Job or CronJob.
Yet, the platform lacks features for managing execution histories or setting dependencies among various jobs.
To ascertain if Argo Workflow and Argo Event fully address these needs, I installed and performed some tests.
Install
Argo-Event
Considering future usage, the installation is done cluster-wide, rather than at the namespace level.
namespace 생성
1
kubectl create namespace argo-events
Deploy Argo Events, SA, ClusterRoles, Sensor Controller, EventBus Controller and EventSource Controller.
1
2
3
kubectl apply -f https://raw.githubusercontent.com/argoproj/argo-events/stable/manifests/install.yaml
# Install with a validating admission controllerkubectl apply -f https://raw.githubusercontent.com/argoproj/argo-events/stable/manifests/install-validating-webhook.yaml
When you follow the getting-started guide for installation, it gets confined to the namespace.
Such a setup might hinder the convenience of using argo-event, so it’s advisable to opt for a cluster-wide installation unless there’s a compelling reason otherwise.
Install CLI
1
2
3
4
5
6
7
8
9
10
11
12
13
14
# Download the binarycurl -sLO https://github.com/argoproj/argo-workflows/releases/download/v3.3.0/argo-darwin-amd64.gz
# Unzipgunzip argo-darwin-amd64.gz
# Make binary executablechmod +x argo-darwin-amd64
# Move binary to pathmv ./argo-darwin-amd64 /usr/local/bin/argo
# Test installationargo version
For a Remote Cluster setup, configure the Routing by following the instructions in this link.
For local setups, opt for the Load Balancer method.
Authorization
By adapting the approach from this link, you can retrieve an existing token and utilize it for login.
Concept
Architecture
Event Source
It’s a resource designed to process external events.
Sensor
The sensor accepts the Event Dependency Set as its input, while the Trigger stipulates the output.
Functioning as an Event Dependency Manager, it processes events relayed via the EventBus and subsequently initiates the Trigger.
Eventbus
It serves as the TransportLayer, bridging EventSources and Sensor.
EventSources are responsible for publishing events, whereas the Sensor subscribes to these events and initiates the Trigger.
Trigger
Once the Sensor resolves the Event Dependencies, it signifies the resource or workload that gets executed.
Feature tested
calendar
webhook-workflow
webhook-k8s-object
cross-namespace
webhook-auth
RBAC Configuration
Operating on the assumption that we’re utilizing argo-workflow and argo-events, let me elucidate.
For argo-workflow, one must provide permissions to inspect the status and logs of the executed pod.
When intending to utilize Argo-Workflow as a Trigger within Argo Events, the following setup is essential.
Given that the object spawned by the Trigger is a Workflow, requisite permissions are needed to access that specific api-resource.
Webhooks are used as EventSources, and the Sensor uses argo-workflow as a Trigger.
Accordingly, to operate, you need to pre-install argo-workflow cluster wide.
This setup resembles the Webhook-Workflow. However, what distinguishes it is that the Sensor triggers a k8s object.
It’s capable of executing Custom Resources, including Pod, Deployment, Job, and CronJob.
The available operations are Create, Update, Patch, and Delete.
The RBAC configurations used until now are restricted to individual namespaces. This poses a challenge as every user needs to be familiar with its usage, potentially causing user inconvenience.
For cross-namespace functionality, all definitions that were previously set as Role need to be converted to ClusterRole.
The provided ClusterRole example is configured solely for pod creation. If other resources are necessary, you can incorporate them and then proceed to use the role.
webhook-auth
For security reasons, it may be necessary to incorporate an authentication token when making a Webhook call.
This approach entails generating an authentication token and subsequently registering it as a Secret, a type of k8s object.
By designating the name of the Secret object, it becomes available for authentication purposes within the Webhook.
From the tests we’ve conducted, it’s evident that the emphasis was placed on assessing functional capabilities rather than operational aspects.
Given that all necessary resources for Batch can be precisely defined using yaml, it enabled seamless GitOps operations.
Moreover, with Argo Event’s extensive support for various Event Sources, we’ve verified that both Webhook and Cron can be utilized to their full potential.
In the upcoming article, I’ll delve into the operational requirements and discuss our approach to evaluating them.