Wrong database name in Nextcloud initContainer
In the deployment template, here: https://github.com/nextcloud/helm/blob/master/charts/nextcloud/templates/deployment.yaml#L274
The commands are using %s-mariadb or %s-postgresql.
Why not use the variable ${MYSQL_HOST} and ${POSTGRESQL_HOST} ?
I tried a deployment with a primary/secondary MariaDB cluster, and the host should then be nextcloud-mariadb-primary instead of nextcloud-mariadb.
Sorry @GillesMocellin , something went wrong and your variable suggestion rendered a bit weird for me:

Could you please fix that to be more readable?
As for the host, perhaps I'm misunderstanding, but does this actually break anything? I am not using mariadb at this time, so maybe I'm missing something.
Thanks for your time and patience!
Sorry, I've edited my post...
I looked at this again and I see what you mean as this: https://github.com/nextcloud/helm/blob/bf6cc4a9df0b3bffd3915dc940ddbec71976429e/charts/nextcloud/templates/deployment.yaml#L316
Doesn't match this: https://github.com/nextcloud/helm/blob/bf6cc4a9df0b3bffd3915dc940ddbec71976429e/charts/nextcloud/templates/deployment.yaml#L335
In fact, we should probably accommodate also using the externalDatabase.host/externalDatabase.existingSecret here as well:
https://github.com/nextcloud/helm/blob/bf6cc4a9df0b3bffd3915dc940ddbec71976429e/charts/nextcloud/templates/deployment.yaml#L330-L331
For the mariaDB init container, we need to add this env var: https://github.com/nextcloud/helm/blob/bf6cc4a9df0b3bffd3915dc940ddbec71976429e/charts/nextcloud/templates/_helpers.tpl#L76-L77
Marking this as "to develop". This might make sense to include in the planned major release for other database related updates in the values.yaml.