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,900 points
29 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

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,100 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
• 35,720 points
20 views
0 votes
1 answer

Pods IP address from inside a container in the pod

Make sure that your pod yaml file ...READ MORE

answered Aug 29, 2018 in Kubernetes by Kalgi
• 35,720 points
29 views
0 votes
1 answer
0 votes
1 answer
+2 votes
5 answers

© 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.