* Pre-requisited from [[Tutorials:Run_the_example_container_on_the_cluster|previous tutorial]].
* Sample code from [[Tutorials:Run_the_example_container_on_the_cluster|previous tutorial]].
== Global dataset storage for large, static datasets ==
The first cluster node exports an NFS filesystem on a large NVMe-Raid, which is reasonably fast and can be used as a global dataset storage. It can be mounted into a pod as follows:
<syntaxhighlight lang="yaml">
apiVersion: v1
kind: Pod
metadata:
name: your-username-test-global-storage
spec:
containers:
- name: your-username-test-global-storage
# we use a small ubuntu base to access the PVC
image: ubuntu:18.04
# make sure that we have some time until the container quits by itself
command: ['sleep', '6h']
volumeMounts:
# Path to mount the NFS volume to
- mountPath: "/mnt/datasets"
name: datasets-nfs
# NFS is exported read-only
readOnly: true
volumes:
# Volume which mounts the NFS server exported to the cluster by ccu-node1
- name: datasets-nfs
nfs:
server: ccu-node1
path: /raid/datasets
</syntaxhighlight>
Please see the page [[CCU:Global dataset storage|on global storage]] for a list of available datasets and the method to upload your own.
Since anyone can mount global persistent volumes in the same namespace, they can and should be used to share datasets. The name of a PVC which contains a useful dataset should start with "dataset-" and be descriptive, so that it can easily be found by other users. Also, the root of the PVC should contain a README with informations about the dataset (at least the source and what exactly it is). Finally, it is probably good practice if other users of the dataset which are not the creator mount the volume readonly (by specifying "readOnly: true" after the mountPath in the pod's yaml).
=== Global dataset storage for large, static datasets ===
The first cluster node exports an NFS filesystem on a large NVMe-Raid, which is reasonably fast and can be used as a global dataset storage. It can be mounted into a pod as follows:
<syntaxhighlight lang="yaml">
apiVersion: v1
kind: Pod
metadata:
name: your-username-test-global-storage
spec:
containers:
- name: your-username-test-global-storage
# we use a small ubuntu base to access the PVC
image: ubuntu:18.04
# make sure that we have some time until the container quits by itself
command: ['sleep', '6h']
volumeMounts:
# Path to mount the NFS volume to
- mountPath: "/mnt/datasets"
name: datasets-nfs
# NFS is exported read-only
readOnly: true
volumes:
# Volume which mounts the NFS server exported to the cluster by ccu-node1
- name: datasets-nfs
nfs:
server: ccu-node1
path: /raid/datasets
</syntaxhighlight>
Please see the page [[CCU:Global dataset storage|on global storage]] for a list of available datasets and the method to upload your own.
== Reading/writing the contents of a persistent volume ==