-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathjob-task-02.yaml
42 lines (41 loc) · 992 Bytes
/
job-task-02.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
kind: Job
metadata:
name: task02
labels:
app: jobtest
apiVersion: batch/v1
spec:
ttlSecondsAfterFinished: 10
parallelism: 1 # In parallel of 1 pod each
completions: 75 # 75 times will run
manualSelector: true
selector:
matchLabels:
clock: round
clock: block
matchExpressions:
- key: clock
operator: In
values: ["round","block"]
activeDeadlineSeconds: 20
template:
metadata:
name: task02
labels:
clock: round
clock: block
spec:
restartPolicy: Never
volumes:
- name: data
hostPath:
path: /opt/
containers:
- command: ["/bin/sh","-c"]
args:
- touch /opt/file && echo "Task is only to print message time $(date +%T) and deleted automatically." | tee -a /opt/file
image: alpine
name: ola
volumeMounts:
- name: data
mountPath: /opt/