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,040 points
1,564 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,040 points
205 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
12,381 views
+4 votes
1 answer

Installing Web UI (Dashboard):kubernetes-dashboard on main Ubuntu 16.04.6 LTS (Xenial Xerus) server

Follow these steps: $ kubeadm reset $ kubeadm init ...READ MORE

answered Apr 12, 2019 in Kubernetes by Kalgi
• 52,350 points

reshown Apr 12, 2019 by Kalgi 4,003 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
1,597 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,040 points
6,877 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