Configured first test webhook for Argo Workflows

This commit is contained in:
Marcin-Ramotowski
2025-08-01 22:30:30 +02:00
parent c99b2be62f
commit c9ffa1c420
4 changed files with 108 additions and 0 deletions

View File

@ -0,0 +1,13 @@
apiVersion: argoproj.io/v1alpha1
kind: EventBus
metadata:
name: default
namespace: argo-events
spec:
nats:
native:
# Optional, defaults to 3.
# If it is < 3, set it to 3, that is the minimal requirement.
replicas: 3
# Optional, authen strategy, "none" or "token", defaults to "none"
auth: token

View File

@ -0,0 +1,38 @@
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: operate-workflow-sa
namespace: argo-events
---
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: operate-workflow-role
namespace: argo-events
rules:
- apiGroups: [ "argoproj.io" ]
resources: [ "workflows" ]
verbs: [ "*" ]
- apiGroups: [ "argoproj.io" ]
resources: [ "workflowtaskresults" ]
verbs: [ "create", "patch" ]
- apiGroups: [ "" ]
resources: [ "pods" ]
verbs: [ "get", "patch" ]
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: operate-workflow-role-binding
namespace: argo-events
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
name: operate-workflow-role
subjects:
- kind: ServiceAccount
name: operate-workflow-sa
namespace: argo-events

View File

@ -0,0 +1,42 @@
---
apiVersion: argoproj.io/v1alpha1
kind: Sensor
metadata:
name: sensor
namespace: argo-events
spec:
template:
serviceAccountName: operate-workflow-sa
dependencies:
- name: dep
eventSourceName: webhook
eventName: test-hook
triggers:
- template:
name: trigger
k8s:
operation: create
source:
resource:
apiVersion: argoproj.io/v1alpha1
kind: Workflow
metadata:
generateName: test-workflow-
spec:
serviceAccountName: operate-workflow-sa
entrypoint: entry-wf
templates:
- name: entry-wf
container:
image: docker/whalesay
command: [cowsay]
args: ["{{ workflow.parameters.argName }}"]
arguments:
parameters:
- name: argName
value: "Default_argName"
parameters:
- src:
dependencyName: dep
dataKey: body.argName
dest: spec.arguments.parameters.0.value

View File

@ -0,0 +1,15 @@
apiVersion: argoproj.io/v1alpha1
kind: EventSource
metadata:
name: webhook
namespace: argo-events
spec:
service:
ports:
- port: 12000
targetPort: 12000
webhook:
test-hook:
endpoint: /example
method: POST
port: "12000"