Skip to content

How to mount to an existing directory? #113

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Slyke opened this issue Jun 12, 2021 · 1 comment
Closed

How to mount to an existing directory? #113

Slyke opened this issue Jun 12, 2021 · 1 comment

Comments

@Slyke
Copy link

Slyke commented Jun 12, 2021

Hello,

Having trouble figuring our how to mount to an existing NFS directory. I have a K3s setup with a bunch of Raspberry Pis and a Synology NAS with NFS. I have successfully setup provisioning so that each pod gets some storage space on the NAS. A folder is automatically created, that I can use to house the files that the pods need.

Now here's my problem: I can't figure out how to set it up so that I can mount an existing directory. I have a Duplicati pod running in the cluster, and while I can have its config directory created and running fine, I can't figure out how to make this provisioner mount an existing directory that's on my NAS so I can create a PV and PVC for Duplicati. I have a bunch of photos that I want Duplicati to keep synced (among other things I need backed up).

Can anyone point me in the right direction?

I did see #5 but when I use --set storageClass.pathPattern="" to setup my second NFS mount, it doesn't seem to do anything, the PVC just creates a folder in that directory.

@Slyke
Copy link
Author

Slyke commented Jun 12, 2021

Figured out a easy way:

apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: test-photos-pvc
  namespace: default
spec:
  storageClassName: ""
  volumeName: test-photos-pv
  accessModes:
   - ReadWriteOnce 
  resources:
    requests:
      storage: 1Mi
---
apiVersion: v1
kind: PersistentVolume
metadata:
  name: test-photos-pv
  namespace: default
spec:
  storageClassName: ""
  capacity:
    storage: 1Mi
  accessModes:
    - ReadWriteOnce
  persistentVolumeReclaimPolicy: Retain
  mountOptions:
    - hard
    - nfsvers=3 # You may need to update this
  nfs:
    server: 10.8.10.10
    path: "/volume1/Photos"
    readOnly: false

@Slyke Slyke closed this as completed Jun 12, 2021
hyakutem pushed a commit to hyakutem/nfs-subdir-external-provisioner that referenced this issue Feb 3, 2023
…t_controller

Fix the install of snapshot CRDs and controller
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant