forked from argoproj/argo-workflows
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsynchronization-mutex-tmpl-level.yaml
45 lines (41 loc) · 1.24 KB
/
synchronization-mutex-tmpl-level.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# This example demonstrates the use of a Synchronization Mutex lock on template execution. Mutex lock limits
# only one of the template execution across the workflows in the namespace which has same Mutex lock.
apiVersion: argoproj.io/v1alpha1
kind: Workflow
metadata:
generateName: synchronization-tmpl-level-mutex-
spec:
entrypoint: synchronization-tmpl-level-mutex-example
templates:
- name: synchronization-tmpl-level-mutex-example
steps:
- - name: synchronization-acquire-lock
template: acquire-lock
arguments:
parameters:
- name: seconds
value: "{{item}}"
withParam: '["1","2","3","4","5"]'
- name: synchronization-acquire-lock1
template: acquire-lock-1
arguments:
parameters:
- name: seconds
value: "{{item}}"
withParam: '["1","2","3","4","5"]'
- name: acquire-lock
synchronization:
mutex:
name: welcome
container:
image: alpine:latest
command: [sh, -c]
args: ["sleep 20; echo acquired lock"]
- name: acquire-lock-1
synchronization:
mutex:
name: test
container:
image: alpine:latest
command: [sh, -c]
args: ["sleep 50; echo acquired lock"]