nfs client #0

Supports: trusty xenial bionic disco
Add to new model


Installs and configures an nfs4 daemon with the standard accompanying services, portmapd and idmapd.

To use this, client services must implement hooks for a storage relation that is compatible with the 'mount' interface ( '' ).

Exported shares get created as new services are joined.

Service units with the same servicename share the same exported filesystem.

Here's a simple example


juju bootstrap

# spin up an app... wiki for example
juju deploy mysql
juju deploy mediawiki
juju add-relation mysql mediawiki

# spin up storage
juju deploy nfs

# add storage to the app
juju deploy --config nfs-client.yaml nfs-client
# config tells it where to mount
juju add-relation mediawiki nfs-client
juju add-relation nfs-client:nfs nfs

but with more than one client service, you've really got to name the sub


juju bootstrap

# spin up a couple of wikis
juju deploy mysql

juju deploy mediawiki wiki1
juju add-relation mysql wiki1

juju deploy mediawiki wiki2
juju add-relation mysql wiki2

# spin up storage
juju deploy nfs uploadstore

juju deploy --config etc/wiki1-nfs-client.yaml nfs-client wiki1-nfs-client
juju add-relation wiki1 wiki1-nfs-client
juju add-relation wiki1-nfs-client:nfs uploadstore

juju deploy --config etc/wiki2-nfs-client.yaml nfs-client wiki2-nfs-client
juju add-relation wiki2 wiki2-nfs-client
juju add-relation wiki2-nfs-client:nfs uploadstore

where wiki1-nfs-client.yaml looks like:

  mountpoint: "/var/lib/mediawiki/images"


(string) Default mount options
(string) Default mount owner
(string) Where to mount the remote share