Skip to content

Commit 524b19b

Browse files
committed
fix:Normalize the command of the job yaml file and modify the job md.
1 parent 1bc56ef commit 524b19b

2 files changed

Lines changed: 8 additions & 3 deletions

File tree

docs/job.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,11 @@ spec:
2424
containers:
2525
- name: echo
2626
image: busybox
27-
command: [for i in 9 8 7 6 5 4 3 2 1 ; do echo $i ; done]
27+
command:
28+
- "/bin/sh"
29+
args:
30+
- "-c"
31+
- "for i in 9 8 7 6 5 4 3 2 1 ; do echo $i ; done"
2832
```
2933
3034
通过下面的命令创建 job,可以通过 `kubectl get pods -w` 来观察 job 创建 pod 的过程和结果。最后可以通过 `logs` 命令查看日志。

job/hello-job.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ spec:
1212
- name: echo
1313
image: busybox
1414
command:
15-
- "bin/sh"
15+
- "/bin/sh"
16+
args:
1617
- "-c"
17-
- "for i in 1 2 3 4 5 6 7 8 9 ; do echo $i ; done"
18+
- "for i in 9 8 7 6 5 4 3 2 1 ; do echo $i ; done"

0 commit comments

Comments
 (0)