Create a volume in kubernetes that won t get destroyed even if the pods die

0 votes

I have a docker image that when created should check if the volume is empty, in case it should initialize it with some data. This saved data must remain available for other pods with the same or different image.

enter image description here

What do you recommend me to do?

Oct 17, 2018 in Kubernetes by Nilesh
• 7,060 points
1,399 views

1 answer to this question.

0 votes

You can use the writemany which should alleviate a deadlock.

apiVersion: v1
kind: PersistentVolume
metadata:
  name: shared-volume
spec:
  capacity:
    storage: 1Gi
  volumeMode: Filesystem
  accessModes:
    - ReadWriteMany
  persistentVolumeReclaimPolicy: Retain
  storageClassName: ""
  mountOptions:
    - hard
    - nfsvers=4.1
  nfs:
    path: /tmp
    server: 172.17.0.2

Persistent Volumes

answered Oct 17, 2018 by lina
• 8,220 points

Related Questions In Kubernetes

0 votes
1 answer

Create kubernetes that manages pods in java

Fabric8's Kubernetes Client is using a generated ...READ MORE

answered Sep 5, 2018 in Kubernetes by Kalgi
• 52,350 points
598 views
0 votes
1 answer
+1 vote
1 answer
+2 votes
1 answer
+2 votes
5 answers
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