Configured first test webhook for Argo Workflows
This commit is contained in:
13
argo-workflows/eventbus-default.yaml
Normal file
13
argo-workflows/eventbus-default.yaml
Normal 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
|
38
argo-workflows/permissions.yaml
Normal file
38
argo-workflows/permissions.yaml
Normal 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
|
42
argo-workflows/sensor.yaml
Normal file
42
argo-workflows/sensor.yaml
Normal 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
|
15
argo-workflows/source.yaml
Normal file
15
argo-workflows/source.yaml
Normal 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"
|
Reference in New Issue
Block a user