Autodelete persistant volume claim when kubernetes job is completed

0 votes
I have created persistent volume claim using delete policy i.e. once the claim is deleted, the associated persistent volume gets deleted.

But I'm trying to figure out if there is a way that allows us to delete a persistent volume claim when a kubernetes job using that claim is completed.

Any help would be appreciated.
Sep 19, 2018 in Kubernetes by Nilesh
• 6,900 points
58 views

1 answer to this question.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
0 votes
@Nilesh your idea seems really nice but unfortunately there is no specific way to do this.

But you can use the cron job concept here. You can design a cron job that deletes the claim and the persistent volume that uses the claim once the job is completed.

You can use cron job with busybox container running a bash script which checks and deletes unused persistent volume claims.
answered Sep 19, 2018 by Kalgi
• 35,750 points

Related Questions In Kubernetes

0 votes
1 answer
0 votes
2 answers

Monitoring kubernetes job

you can do watch 'kubectl get pods | ...READ MORE

answered Sep 3, 2018 in Kubernetes by Nilesh
• 6,900 points
20 views
0 votes
2 answers

NoSuchBucket error when running Kubernetes on AWS

It was a bug on their part. ...READ MORE

answered Sep 4, 2018 in Kubernetes by Nilesh
• 6,900 points
21 views
0 votes
1 answer

image can't be pulled error when I try to pull a docker image - kubernetes

I think the image is being pulled ...READ MORE

answered Sep 4, 2018 in Kubernetes by Kalgi
• 35,750 points
181 views
0 votes
1 answer
0 votes
3 answers

Error while joining cluster with node

Hi Kalgi after following above steps it ...READ MORE

answered Jan 17 in Others by anonymous
458 views
+3 votes
1 answer
0 votes
1 answer

Pod not sharing directory - Kubernetes volume Hostpath

he issue was on the volume definition, ...READ MORE

answered Aug 28, 2018 in Kubernetes by Kalgi
• 35,750 points
154 views
0 votes
2 answers

Restart pods when configmap updates in Kubernetes?

Use Deployments, and consider your ConfigMaps to ...READ MORE

answered Aug 31, 2018 in Kubernetes by Nilesh
• 6,900 points
2,085 views

© 2018 Brain4ce Education Solutions Pvt. Ltd. All rights Reserved.
"PMP®","PMI®", "PMI-ACP®" and "PMBOK®" are registered marks of the Project Management Institute, Inc. MongoDB®, Mongo and the leaf logo are the registered trademarks of MongoDB, Inc.