diff --git a/infrastructure/cluster/flux/cvmfs/README.md b/infrastructure/cluster/flux/cvmfs/README.md new file mode 100644 index 00000000..59f36c6c --- /dev/null +++ b/infrastructure/cluster/flux/cvmfs/README.md @@ -0,0 +1,10 @@ +# CVMFS +## CVMFS on the VRE + +CERN OpenStack k8s cluster v1.29.2 is deployed with a `cvmfs StorageClass` provisioned by `cvmfs.csi.cern.ch` and the CVMFS CSI (Container Storage Interface) plugin [link to github repository](https://github.com/cvmfs-contrib/cvmfs-csi). Version `cvmfs-csi-v2.3.2` of the CVMFS charts is installed. + +To provision a cvmfs volume within any jupyterhub pod: +* Create a `pvc` making use of the cvms `StorageClass` +* Add an `extraVolumes` and an `extraVolumeMounts` in the [JupyterHub release manifest](../jhub/jhub-release.yaml). + +The manifests in this directory will also deploy a pod (`cvmfs-client`) to access cvmfs from the cluster. \ No newline at end of file diff --git a/infrastructure/cluster/flux/cvmfs/cvmfs-client.yaml b/infrastructure/cluster/flux/cvmfs/cvmfs-client.yaml new file mode 100644 index 00000000..bc8e3285 --- /dev/null +++ b/infrastructure/cluster/flux/cvmfs/cvmfs-client.yaml @@ -0,0 +1,20 @@ +apiVersion: v1 +kind: Pod +metadata: + name: cvmfs-client + namespace: jhub +spec: + containers: + - name: idle + image: busybox + imagePullPolicy: IfNotPresent + command: [ "/bin/sh", "-c", "trap : TERM INT; (while true; do sleep 1000; done) & wait" ] + volumeMounts: + - name: cvmfs + mountPath: /cvmfs + # CVMFS automount volumes must be mounted with HostToContainer mount propagation. + mountPropagation: HostToContainer + volumes: + - name: cvmfs + persistentVolumeClaim: + claimName: cvmfs-vre-pvc diff --git a/infrastructure/cluster/flux/cvmfs/cvmfs-pvc.yaml b/infrastructure/cluster/flux/cvmfs/cvmfs-pvc.yaml new file mode 100644 index 00000000..64b04420 --- /dev/null +++ b/infrastructure/cluster/flux/cvmfs/cvmfs-pvc.yaml @@ -0,0 +1,32 @@ + +# Based on docs and snippets from https://github.com/cvmfs-contrib/cvmfs-csi + +# Create StorageClass for provisioning CVMFS automount volumes, +# and a PersistentVolumeClaim that's fulfilled by the StorageClass. + +# If Controller plugin is not deployed, follow the example in volume-pv-pvc.yaml. + +# Notes for the VRE cluster. +# StorageClass is not needed because is already deployed when starting the cluster. +# Othersiwe, have a look to the documentation on the link above +# --- +# apiVersion: storage.k8s.io/v1 +# kind: StorageClass +# metadata: +# name: cvmfs +# provisioner: cvmfs.csi.cern.ch +# --- +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: cvmfs-vre-pvc + namespace: jhub +spec: + accessModes: + - ReadOnlyMany + resources: + requests: + # Volume size value has no effect and is ignored + # by the driver, but must be non-zero. + storage: 1 + storageClassName: cvmfs \ No newline at end of file diff --git a/infrastructure/cluster/flux/jhub/jhub-release.yaml b/infrastructure/cluster/flux/jhub/jhub-release.yaml index 0f5f1158..239e0792 100644 --- a/infrastructure/cluster/flux/jhub/jhub-release.yaml +++ b/infrastructure/cluster/flux/jhub/jhub-release.yaml @@ -31,7 +31,6 @@ spec: - kind: ConfigMap name: jhub-profiles valuesKey: values.yaml - #targetPath: singleuser.profileList values: proxy: @@ -147,18 +146,18 @@ spec: type: static static: pvcName: jhub-vre-singleuser-preprovisioned-manila-pvc # manually added an existing share (refer to jhub-storage.yaml) - # extraVolumes: - # - name: cvmfs-cern-instance - # persistentVolumeClaim: - # claimName: cvmfs + extraVolumes: + - name: cvmfs-vre + persistentVolumeClaim: + claimName: cvmfs-vre-pvc # - name: eulake-cern-eos-rse # mounts the EOS RSE needed for the Rucio JupiterLab extension # hostPath: # path: /var/eos/eulake # This is pointing to /eos/eulake/escape/data, defined on the eosxd/configmap - # extraVolumeMounts: - # - name: cvmfs-cern-instance - # mountPath: /cvmfs - # # CVMFS automount volumes must be mounted with HostToContainer mount propagation. - # mountPropagation: HostToContainer + extraVolumeMounts: + - name: cvmfs-vre + mountPath: /cvmfs + # CVMFS automount volumes must be mounted with HostToContainer mount propagation. + mountPropagation: HostToContainer # - name: eulake-cern-eos-rse # mounts the EOS RSE needed for the Rucio JupiterLab extension # mountPath: /eos/cern-eos-rse # mountPropagation: HostToContainer