Skip to content

Conversation

@Javex
Copy link

@Javex Javex commented Nov 29, 2025

Description of the change

By default, when persistence is enabled, the volume "nextcloud-main" is used to store Nextcloud data. The chart offers an option to create an extra PVC using persistence.nextcloudData.

However, it's not possible to mount data from an external source. Even though extraVolumes and extraVolumeMounts are available, the data folder is either sourced from "nextcloud-main" or "nextcloud-data".

By providing an option to skip mounting the "data" subfolder when using the main persistence option, but not the nextcloudData option, it is possible to provide a custom volume mount based on a different volume specified in extraVolumes.

This allows, for example, to supply an NFS mount point:

nextcloud:
  extraVolumes:
    - name: data
      nfs:
        path: /mnt/nextcloud
        server: my-nfs-server.example.com

  extraVolumeMounts:
    - name: data
      mountPath: /var/www/html/data

persistence:
  # Create a PVC to store Nextcloud application data
  enabled: true
  # But don't mount the user data folder, as it is provided above
  dataVolumeMount: false

Benefits

Users with specific storage setup can customise how their data gets mounted. For example, I have an existing Nextcloud installation that I want to migrate to Kubernetes, but the data is already in an NFS server and I just want to mount that.

Possible drawbacks

It's possible I missed a configuration combination that doesn't make sense here, there are many ways to combine options in this chart.

Applicable issues

N/A

Additional information

I've first tried to use the NFS CSI driver, but it caused quite a few issues. This would have worked without needing to change the helm chart. However, it did not work out due to all problems this caused me.

Checklist

By default, when persistence is enabled, the volume "nextcloud-main" is
used to store Nextcloud data. The chart offers an option to create an
extra PVC using persistence.nextcloudData.

However, it is not possible to mount data from an external source. Even
though extraVolumes and extraVolumeMounts are available, the data folder
is either sourced from "nextcloud-main" or "nextcloud-data".

By providing an option to skip mounting the "data" subfolder when using
the main persistence option, but not the nextcloudData option, it is
possible to provide a custom volume mount based on a different volume
specified in extraVolumes.

This allows, for example, to supply an NFS mount point:

```yaml
nextcloud:
  extraVolumes:
    - name: data
      nfs:
        path: /mnt/nextcloud
        server: my-nfs-server.example.com

  extraVolumeMounts:
    - name: data
      mountPath: /var/www/html/data

persistence:
  # Create a PVC to store Nextcloud application data
  enabled: true
  # But don't mount the user data folder, as it is provided above
  dataVolumeMount: false
```

Signed-off-by: Florian Ruechel <code@inexplicity.de>
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

Successfully merging this pull request may close these issues.

1 participant