forked from argoproj/argo-workflows
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Owner reference example (argoproj#839)
* Example using resource that will be GC'd. * Document owner reference option.
- Loading branch information
Showing
2 changed files
with
32 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,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 |