Skip to content

Commit 61ab60c

Browse files
committed
docs: add details about our Argo Workflows / Events installation
Document how Argo Workflows and Argo Events are currently installed and how we should utilize them.
1 parent 6067f54 commit 61ab60c

File tree

3 files changed

+132
-0
lines changed

3 files changed

+132
-0
lines changed

docs/design-guide/argo-events.md

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
# Argo Events
2+
3+
The UnderStack project utilizes [Argo Events][argo-events] to provide
4+
uniform event-driven automation. Operations can be provided within
5+
UnderStack or defined by users to provide additional operations on
6+
events.
7+
8+
Some examples of how UnderStack utilizes Argo Events are:
9+
10+
* Listen to OpenStack notifications via RabbitMQ message queues
11+
* Propagate updates to Nautobot for inventory synchronization
12+
* Trigger asynchronous operations that are outside the scope of OpenStack plugins
13+
* Maintain loose coupling between OpenStack and external automation workflows
14+
15+
## Architecture & Security Model
16+
17+
[Argo Events][argo-events] operates within the namespace (argo-events),
18+
while the actual [EventSources][argo-events-eventsource] and [Sensors][argo-events-sensor]
19+
run in other namespaces on the cluster.
20+
21+
### Argo Events Configuration
22+
23+
We install the controller and the validating webhook into the (argo-events)
24+
namespace.
25+
26+
## EventSource and Sensor Configuration
27+
28+
[Sensors][argo-events-sensor] must be co-located with the [EventSource][argo-events-eventsource]
29+
they are using so you will find them in multiple namespaces.
30+
31+
### Proper Definitions
32+
33+
You must configure the `dependencies` section of your [Sensor][argo-events-sensor]
34+
correctly for it to properly trigger on events. For example below is
35+
a partial snippet of an [argo-events-eventsource] named `openstack-neutron`
36+
which provides one event named `notifications`:
37+
38+
```yaml
39+
apiVersion: argoproj.io/v1alpha1
40+
kind: EventSource
41+
metadata:
42+
name: openstack-neutron # THIS IS YOUR eventSourceName
43+
spec:
44+
amqp:
45+
notifications: # THIS IS YOUR eventName
46+
url: amqp://localhost
47+
routingKey: key
48+
```
49+
50+
Your [Sensor][argo-events-sensor] would need to be defined as follows:
51+
52+
```yaml
53+
apiVersion: argoproj.io/v1alpha1
54+
kind: Sensor
55+
metadata:
56+
name: my-sensor
57+
spec:
58+
dependencies:
59+
- eventName: notifications # MUST MATCH ABOVE
60+
eventSourceName: openstack-neutron # MUST MATCH ABOVE
61+
name: your-choice
62+
```
63+
64+
### Service Accounts
65+
66+
[ServiceAccount][argo-events-sensor-sa]s need to be specifically
67+
configured for the [Sensor][argo-events-sensor] to be able to execute
68+
the operation that you would like to happen in response to the event. These
69+
service accounts should be created with the minimal permissions necessary
70+
for the sensor and to then execute the operation. For example, many of our
71+
existing [Sensor][argo-events-sensor]s execute [Argo Workflow](./argo-workflows.md)s
72+
in response to a trigger so they only need to be able to create the workflow
73+
from the workflowtemplate.
74+
75+
[argo-events]: <https://argoproj.github.io/argo-events/>
76+
[argo-events-sensor]: <https://argoproj.github.io/argo-events/concepts/sensor/>
77+
[argo-events-eventsource]: <https://argoproj.github.io/argo-events/concepts/event_source/>
78+
[argo-events-sensor-sa]: <https://argoproj.github.io/argo-events/service-accounts/#service-account-for-sensors>
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# Argo Workflows
2+
3+
The UnderStack project utilizes [Argo Workflows][argo-wf] as its
4+
workflow orchestration engine for managing complex, multi-step
5+
operations across the infrastructure stack. [Argo Workflows][argo-wf]
6+
provides a Kubernetes-native approach to defining and executing
7+
workflows, enabling reliable automation of provisioning, deployment,
8+
and maintenance tasks.
9+
10+
## Architecture & Security Model
11+
12+
[Argo Workflows][argo-wf] operates within a dedicated namespace (argo),
13+
while the actual workflows run in another dedicated namespace (argo-events),
14+
to ensure proper security isolation and resource control. This separation
15+
is provided by [Argo Workflows][argo-wf] but poorly documented upstream which
16+
they call [Managed Namespace][argo-wf-managed-ns].
17+
18+
### Argo Workflows Configuration
19+
20+
We do not use the `namespace-install.yaml` provided by the project as it
21+
combines everything into one YAML and we need to split it out. It combines:
22+
23+
* CRDs
24+
* Argo Server, which is the UI and the API for Argo Workflows and Argo Events
25+
* Argo Workflows Controller, which is the executor for the workflow and creates
26+
the pods
27+
* Server Role, which is the Role and RoleBinding for the Argo Server to access
28+
the workflow, the pods, the logs, and inputs for user visibility
29+
* Workflow Controller Role, which is the Role and RoleBinding to give the controller
30+
access to run and manage the workflows.
31+
32+
The CRDs, the Argo Server, and the Argo Workflow Controller will all be installed
33+
into the (argo) namespace while the 2 Roles and RoleBindings need to be installed
34+
into the namespace where the workflow execute, which is (argo-events).
35+
36+
The Argo Server and the Workflow Controller additionally need access to additional
37+
resources. The Argo Server needs access to the configmap, the SSO secret
38+
39+
## Template-Only Execution Model
40+
41+
Understack enforces a strict template-only execution model where all workflows
42+
must be pre-defined as [WorkflowTemplate][argo-wf-tmpl]s. This approach ensures:
43+
44+
* Consistency: All workflows follow approved patterns and standards
45+
* Security: No arbitrary workflow submission; all templates are reviewed and versioned
46+
* Reusability: Common operations are defined once and parameterized for different
47+
use cases
48+
* Governance: Changes to workflows go through code review and CI/CD processes
49+
50+
[argo-wf]: <https://argo-workflows.readthedocs.io/en/latest/>
51+
[argo-wf-managed-ns]: <https://argo-workflows.readthedocs.io/en/stable/managed-namespace/>
52+
[argo-wf-tmpl]: <https://argo-workflows.readthedocs.io/en/stable/workflow-templates/>

mkdocs.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,8 @@ nav:
120120
- 'Design Guide':
121121
- design-guide/intro.md
122122
- design-guide/neutron-networking.md
123+
- design-guide/argo-workflows.md
124+
- design-guide/argo-events.md
123125
- 'Deployment Guide':
124126
- deploy-guide/welcome.md
125127
- deploy-guide/requirements.md

0 commit comments

Comments
 (0)