forked from argoproj/argo-workflows
-
Notifications
You must be signed in to change notification settings - Fork 0
/
pod-gc-strategy.yaml
35 lines (31 loc) · 960 Bytes
/
pod-gc-strategy.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
# pod gc provides the ability to delete pods automatically without deleting the workflow
apiVersion: argoproj.io/v1alpha1
kind: Workflow
metadata:
generateName: pod-gc-strategy-
spec:
entrypoint: pod-gc-strategy
podGC:
# pod gc strategy must be one of the following
# * OnPodCompletion - delete pods immediately when pod is completed (including errors/failures)
# * OnPodSuccess - delete pods immediately when pod is successful
# * OnWorkflowCompletion - delete pods when workflow is completed
# * OnWorkflowSuccess - delete pods when workflow is successful
strategy: OnPodSuccess
templates:
- name: pod-gc-strategy
steps:
- - name: fail
template: fail
- name: succeed
template: succeed
- name: fail
container:
image: alpine:3.7
command: [sh, -c]
args: ["exit 1"]
- name: succeed
container:
image: alpine:3.7
command: [sh, -c]
args: ["exit 0"]