argo-workflows icon indicating copy to clipboard operation
argo-workflows copied to clipboard

Finalizer for kubernetes resources created by a workflow

Open boniek83 opened this issue 1 year ago • 1 comments

Summary

I want to make sure that kubernetes resource created by a workflow is deleted when workflow fails or is deleted. Currently using onExit doesn't guarantee that. I can run kubectl delete workflow - it will skip onExit, I can run argo terminate (or press terminate in UI) - it will skip onExit. What happens if argo itself stops working?

Probably related to https://github.com/argoproj/argo-workflows/issues/7860

Use Cases

I want to make sure that SparkApplications (that use a lot of resources) started by a Workflow die with a Workflow.


Message from the maintainers:

Love this enhancement proposal? Give it a 👍. We prioritise the proposals with the most 👍.

boniek83 avatar Oct 18 '22 12:10 boniek83

Use resource template and specify ownerReference.

terrytangyuan avatar Oct 18 '22 12:10 terrytangyuan

@terrytangyuan This doesn't work with SparkApplications (https://github.com/GoogleCloudPlatform/spark-on-k8s-operator). When setOwnerReference is set on resource of SparkApplication type SparkApplication stops working correctly.

boniek83 avatar Nov 08 '22 14:11 boniek83