-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathexample.yaml
101 lines (100 loc) · 2.65 KB
/
example.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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
apiVersion: api.practice.com/v1alpha1
kind: JobFlow
metadata:
name: jobflow-example
spec:
# 可配置任务流中的全局参数,当设置后会在每个 job 与 pod 中都生效
globalParams:
# 可决定所有 job 都运行在同一节点上
# nodeName: minikube
# 可加入 container 所需的参数
env:
- name: "FOO"
value: "bar"
- name: "QUE"
value: "pasa"
# job pod 的 annotations
annotations:
key1: value1
key2: value2
# job pod 的 labels
labels:
key1: value1
key2: value2
# 可填写多个 flow 流程
# 每个 flow 中重要字段 分别为:
# name: flow 名称,多个 flow 名称不能重复
# dependencies: 定义依赖项,如果有多个依赖可以填写多个
# jobTemplate: job 模版,支持 k8s 原生 job spec 全部字段
flows:
- name: job1
dependencies: []
jobTemplate:
template:
spec:
containers:
- image: busybox:1.28
command:
- sh
- -c
- sleep 10s
imagePullPolicy: IfNotPresent
name: nginx
- name: job2
jobTemplate:
template:
spec:
containers:
- image: busybox:1.28
command:
- sh
- -c
- sleep 100s
imagePullPolicy: IfNotPresent
name: nginx
dependencies:
- job1 # 代表 job2 依赖 job1 完成后才开始启动
- name: job3
jobTemplate:
template:
spec:
containers:
- image: busybox:1.28
command:
- sh
- -c
- sleep 100s
imagePullPolicy: IfNotPresent
name: nginx
dependencies:
# 代表 job3 依赖 job1 job2 完成后才开始启动
- job1
- job2
- name: job4
jobTemplate:
template:
spec:
containers:
- image: busybox:1.28
command:
- sh
- -c
- sleep 10s
imagePullPolicy: IfNotPresent
name: nginx
- name: job5
dependencies:
# 代表依赖 job2 job4 后才执行
- job4
- job2
jobTemplate:
template:
spec:
containers:
- image: busybox:1.28
command:
- sh
- -c
- sleep 10s
imagePullPolicy: IfNotPresent
name: nginx