-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
115 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,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 |