facing issue with filestore persistent volume in gke

1/26/2019

I am using google filestore for persistent volume in kubernetes. But it is mounting only the root folder not its contents.

I am using GKE service and perform the following tasks:

volume-create:

apiVersion: v1
kind: PersistentVolume
metadata:
  name: volume1
spec:
  capacity:
    storage: 10Gi
  accessModes:
  - ReadWriteMany
  nfs:
    server: x.x.x.x
    path: /share

Persistent volume claim:

apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: volume1-claim
spec:
  accessModes:
  - ReadWriteMany
  storageClassName: ""
  volumeName: volume1
  resources:
    requests:
      storage: 3Gi

apiVersion: apps/v1beta1
kind: Deployment
metadata:
  name: image1
spec:
  template:
    metadata:
      labels:
        name: image1
    spec:
      restartPolicy: Always
      volumes:
      - name: volume
        persistentVolumeClaim:
          claimName: volume1-claim
      containers:
      - name: image1
        image: gcr.io/project-gcr/image:1.0
        imagePullPolicy: Always
        volumeMounts:
        - name: volume
          mountPath: "/app/data"

But it mounting empty folder app/data not its contents. I also referred the below URL: https://cloud.google.com/filestore/docs/accessing-fileshares

Any help is appreciated.

-- sanjiv
disk
google-kubernetes-engine
yaml

1 Answer

1/28/2019

Are you trying to mount an already existing persistent disk?

If so, you will need to define the disk in your configuration file.

You can find more information here.

What kind of data is located on /app/data , is it on a VM? Can you give me some more information on your deployment? How are you testing viewing your data?

The more details I have, the more specific we can be with the help we can provide.

-- James B
Source: StackOverflow