forked from argoproj/argo-workflows
-
Notifications
You must be signed in to change notification settings - Fork 0
/
k8s-owner-reference.yaml
30 lines (30 loc) · 894 Bytes
/
k8s-owner-reference.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
# This example creates a Kubernetes resource that will be deleted
# when the workflow is deleted via Kubernetes GC.
#
# A configmap is used for this example, but the same approach would apply
# to other more interesting resource types.
#
# https://kubernetes.io/docs/concepts/workloads/controllers/garbage-collection/
apiVersion: argoproj.io/v1alpha1
kind: Workflow
metadata:
generateName: k8s-owner-reference-
spec:
entrypoint: k8s-owner-reference
templates:
- name: k8s-owner-reference
resource:
action: create
manifest: |
apiVersion: v1
kind: ConfigMap
metadata:
generateName: owned-eg-
ownerReferences:
- apiVersion: argoproj.io/v1alpha1
blockOwnerDeletion: true
kind: Workflow
name: "{{workflow.name}}"
uid: "{{workflow.uid}}"
data:
some: value