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
• 6,880 points
62 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,110 points

Related Questions In Kubernetes

0 votes
1 answer
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
• 40,460 points
31 views
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
+2 votes
5 answers