forked from argoproj/argo-workflows
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsynchronization-tmpl-level.yaml
37 lines (36 loc) · 1.06 KB
/
synchronization-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
# This example demonstrates the use of a Synchronization lock on template execution. Synchronization lock limits
# the number of concurrent template execution across the workflows in the namespace which has same Synchronization lock.
# Synchronization limit value can be configured in configmap. Eg.:
# apiVersion: v1
# kind: ConfigMap
# metadata:
# name: my-config
# data:
# template: "3"
#---
apiVersion: argoproj.io/v1alpha1
kind: Workflow
metadata:
generateName: synchronization-tmpl-level-
spec:
entrypoint: synchronization-tmpl-level-example
templates:
- name: synchronization-tmpl-level-example
steps:
- - name: synchronization-acquire-lock
template: acquire-lock
arguments:
parameters:
- name: seconds
value: "{{item}}"
withParam: '["1","2","3","4","5"]'
- name: acquire-lock
synchronization:
semaphore:
configMapKeyRef:
name: my-config
key: template
container:
image: alpine:latest
command: [sh, -c]
args: ["sleep 10; echo acquired lock"]