0

I need to deploy that need plenty of volumes from different directory so i'm currently trying to use the subpath feature in a nfs volume but i keep getting this error : Error: failed to prepare subPath for volumeMount "site-data" of container "test-app.

When i do not mention the "subpath" directive it's working properly. Also, on the nfs server, i can see that openshift create himself the subpath directory (so i assume that the directory is writable by the cluster).

Here is the detail :

Openshift version :

oc v3.11.0+0cbc58b
kubernetes v1.11.0+d4cacc0
features: Basic-Auth GSSAPI Kerberos SPNEGO

Server https://192.168.42.202:8443
kubernetes v1.11.0+d4cacc0

/etc/exports on the nfs server :

/tmp/datacontainer *(rw,no_root_squash,insecure) #testopenshift

Volume Information :

apiVersion: v1
kind: PersistentVolume
metadata:
  name: nfs-v242
spec:
  capacity:
    storage: 3Gi 
  accessModes:
  - ReadWriteMany 
  nfs: 
    path: /tmp/datacontainer
    server: 10.0.10.242
  persistentVolumeReclaimPolicy: Retain

Persistent volume claim :

apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  annotations:
  name: claimv242
  namespace: myproject
spec:
  accessModes:
  - ReadWriteMany
  resources:
    requests:
      storage: 2Gi
  volumeName: nfs-v242

Mount point section in my deployment :

  volumeMounts:
        - mountPath: /tmp/log
          name: site-data
          subPath: logdir
      volumes:
      - name: site-data
        persistentVolumeClaim:
          claimName: claimv242

Could someone help me with my issue ?

Axelinux
  • 96
  • 6
  • There are a few similar issues created on kubernetes github. You can simply search for `Error: failed to prepare subPath for volumeMount of container`. You're using kubernetes version which is quite old and not supported any more so I think there is quite a big chance that your issue is already fixed in some newer version. – mario Dec 20 '19 at 16:58
  • Hello, unfortunately, i'm using te latest OKD which integrate this kubernetes version. I will try to switch to Openshift from Redhat which integrate a newer version of Kubernetes. Thanks. – Axelinux Dec 23 '19 at 08:50

0 Answers0