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
• 7,060 points
2,870 views

1 answer to this question.

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
• 52,350 points

Related Questions In Kubernetes

0 votes
2 answers

Monitoring kubernetes job

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

answered Sep 3, 2018 in Kubernetes by Nilesh
• 7,060 points
946 views
+1 vote
1 answer
0 votes
3 answers

Error while joining cluster with node

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

answered Jan 17, 2019 in Others by anonymous
15,456 views
+15 votes
2 answers

Git management technique when there are multiple customers and need multiple customization?

Consider this - In 'extended' Git-Flow, (Git-Multi-Flow, ...READ MORE

answered Mar 27, 2018 in DevOps & Agile by DragonLord999
• 8,450 points
4,024 views
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
• 52,350 points
2,249 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
• 7,060 points
7,624 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP