generated from kubernetes/kubernetes-template-project
-
Notifications
You must be signed in to change notification settings - Fork 51
/
success-policy.yaml
47 lines (47 loc) · 1.08 KB
/
success-policy.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
apiVersion: jobset.x-k8s.io/v1alpha2
kind: JobSet
metadata:
name: success-policy
spec:
# We want to declare our JobSet successful if workers finish.
# If workers finish we should clean up the remaining replicatedJobs.
successPolicy:
operator: All
targetReplicatedJobs:
- workers
replicatedJobs:
- name: leader
replicas: 1
template:
spec:
# Set backoff limit to 0 so job will immediately fail if any pod fails.
backoffLimit: 0
completions: 1
parallelism: 1
template:
spec:
containers:
- name: leader
image: bash:latest
command:
- bash
- -xc
- |
sleep 10000
- name: workers
replicas: 1
template:
spec:
backoffLimit: 0
completions: 2
parallelism: 2
template:
spec:
containers:
- name: worker
image: bash:latest
command:
- bash
- -xc
- |
sleep 10