CephFS shares
A CephFS share gives your Pods a ReadWriteMany or ReadOnlyMany volume that any number of Pods on any node can mount at once. The share stays in your Arbutus project: you create, resize and delete it in OpenStack, it counts against your project’s Manila quota, and your VMs can mount it at the same time as your Pods. Kestrel never creates, resizes or deletes a share.
You never create a PersistentVolume. You create a Secret holding the share’s access key and a PersistentVolumeClaim annotated with the share’s path, and Kestrel creates a PersistentVolume for that claim and binds it.
1. Create the share
Section titled “1. Create the share”Skip this step to use a share you already have.
- Log in to the Arbutus dashboard and select your project.
- Go to Project → Share → Shares and click Create Share.
- Fill in:
- Share Name: a name for the share
- Share Protocol:
CephFS - Size (GiB): the capacity you need
- Share Type:
cephfs
- Click Create, and wait until the share’s Status is
Available.
openstack share create --name <share> --share-type cephfs CEPHFS <size-in-GiB>openstack share show <share> -c status # wait for "available"The share’s size is its real limit: writes fail once it is full. Grow it in OpenStack (Extend Share in Horizon, openstack share resize <share> <new-size> on the CLI); nothing on Kestrel changes.
2. Create an access rule and read the key and path
Section titled “2. Create an access rule and read the key and path”An access rule creates a cephx key that can mount this share and nothing else. Name the rule for what will use it, such as kestrel-<tenant>. That name becomes the key’s user ID.
- In Project → Share → Shares, open the drop-down menu on the share’s row and choose Manage Rules.
- Click Add Rule and fill in:
- Access Type:
cephx - Access Level:
read-write, orread-onlyfor a share your Pods only read - Access To: the rule name, for example
kestrel-<tenant>
- Access Type:
- Click Add, and wait until the rule’s status is
active. The rule’s Access Key column then shows the key. - Click the share’s name to open its overview. Under Export locations, the Path looks like
<monitor>:6789,<monitor>:6789,<monitor>:6789:/volumes/_nogroup/<uuid>/<uuid>.
openstack share access create <share> cephx kestrel-<tenant> --access-level rw # or roopenstack share access list <share> # the access key appears once the state is "active"openstack share export location list <share> # the Path columnNote down three values:
| Value | Where it comes from | Example |
|---|---|---|
| Access name | the rule’s Access To | kestrel-<tenant> |
| Access key | the rule’s Access Key | AQ...== |
| Share path | the export location Path, from /volumes onwards, with no monitors | /volumes/_nogroup/<uuid>/<uuid> |
3. Give your Pods ownership of the share (read-write only)
Section titled “3. Give your Pods ownership of the share (read-write only)”A new share’s top directory is owned by root with mode 755. Kestrel Pods must run as a non-root user, and Kestrel does not change a share’s ownership for them: setting fsGroup in a Pod has no effect on a CephFS share. Unless you change the ownership once, your Pods can read the share but every write fails with Permission denied.
Choose the user and group ID your Pods will run as, 1000:1000 in these examples. On a VM in your Arbutus project, install the Ceph client:
sudo apt-get updatesudo apt-get install -y ceph-common # Ubuntu / Debian; use your distribution's ceph-common package elsewhereCreate /etc/ceph/ceph.conf, unless the VM already has one. This is the Arbutus configuration from the Alliance CephFS page. If your share’s Path from step 2 lists different monitors, use those.
sudo tee /etc/ceph/ceph.conf > /dev/null <<'EOF'[global]admin socket = /var/run/ceph/$cluster-$name-$pid.asokclient reconnect stale = truedebug client = 0/2fuse big writes = truemon host = [v2:134.87.15.61:3300/0,v1:134.87.15.61:6789/0] [v2:134.87.15.62:3300/0,v1:134.87.15.62:6789/0] [v2:134.87.15.63:3300/0,v1:134.87.15.63:6789/0][client]quota = trueEOFCreate a keyring file for the access rule. Paste the key at the prompt, which keeps it out of your shell history and off the screen:
sudo install -m 600 /dev/null /etc/ceph/ceph.client.<access-name>.keyringread -rsp 'Access key: ' KEY; echo; printf '[client.<access-name>]\n key = %s\n' "$KEY" | sudo tee /etc/ceph/ceph.client.<access-name>.keyring > /dev/null; unset KEYMount the share, change the owner, then remove the keyring:
sudo mkdir -p /mnt/sharesudo mount -t ceph :/volumes/_nogroup/<uuid>/<uuid> /mnt/share -o name=<access-name>sudo chown 1000:1000 /mnt/sharesudo umount /mnt/sharesudo rm /etc/ceph/ceph.client.<access-name>.keyringThe path is the Share path from step 2. The leading : is required: it makes the mount read the monitors from ceph.conf. Use a read-write access rule for this mount.
You only need to do this once per share. Skip it when the share is read-only for your Pods, or when it already holds data owned by the user your Pods run as. To give several users access, change the group instead (for example sudo chgrp 2000 /mnt/share && sudo chmod 2775 /mnt/share) and run your Pods with that group.
4. Store the key in a Secret
Section titled “4. Store the key in a Secret”Create the Secret in the namespace whose Pods will mount the share, before you create the claim. userID is the access name, without a client. prefix, and userKey is the access key.
Seal the Secret and commit the SealedSecret alongside the claim. See Sealed Secrets on Kestrel for installing kubeseal.
kubectl create secret generic <share>-cephx \ --namespace <tenant>-prod \ --from-literal=userID=<access-name> \ --from-literal=userKey=<access-key> \ --dry-run=client -o yaml \ | kubeseal --format yaml --controller-namespace sealed-secrets > <share>-cephx-sealedsecret.yamlGive the SealedSecret the argocd.argoproj.io/sync-wave: "-1" annotation, so ArgoCD applies it before the claim.
kubectl create secret generic <share>-cephx \ --namespace <tenant>-prod \ --from-literal=userID=<access-name> \ --from-literal=userKey=<access-key>5. Create the claim
Section titled “5. Create the claim”apiVersion: v1kind: PersistentVolumeClaimmetadata: name: shared-data namespace: <tenant>-prod annotations: rcs.uvic.ca/share-path: /volumes/_nogroup/<uuid>/<uuid> rcs.uvic.ca/share-secret: <share>-cephxspec: storageClassName: '' volumeName: <tenant>-prod-shared-data accessModes: - ReadWriteMany resources: requests: storage: 1GivolumeNamemust be exactly<namespace>-<claim name>.accessModesholds one mode:ReadWriteMany, orReadOnlyManyto mount the share read-only.storageshould be a nominal1Gi. It limits nothing, because the share’s size in OpenStack does, but it still counts against your tenant’s storage quota. See Quotas.
Within a few seconds the claim is Bound to a volume of the same name:
kubectl get pvc shared-data -n <tenant>-prod# NAME STATUS VOLUME CAPACITY ACCESS MODES# shared-data Bound <tenant>-prod-shared-data 1Gi RWXThe PersistentVolume is cluster-scoped and created by Kestrel, so you see only the claim.
6. Mount it in a Pod
Section titled “6. Mount it in a Pod”Mount the claim as you would any other, and run as the user and group from step 3:
spec: securityContext: runAsNonRoot: true runAsUser: 1000 runAsGroup: 1000 seccompProfile: type: RuntimeDefault containers: - name: app image: your-image:latest securityContext: allowPrivilegeEscalation: false capabilities: drop: [ALL] volumeMounts: - name: shared mountPath: /data volumes: - name: shared persistentVolumeClaim: claimName: shared-dataEvery Pod that mounts the claim, on any node, sees the same files, and so does any VM that mounts the share.
To mount a sub-folder with subPath, create the sub-folder first. The kubelet creates a missing subPath owned by root, and step 3’s chown covers only the share’s top directory, so a non-root Pod cannot write to it. Create it from a VM with the share mounted as in step 3 (sudo install -d -o 1000 -g 1000 /mnt/share/<folder>), or from a Pod running as the share’s owner (mkdir /data/<folder>).
Changing and removing a share
Section titled “Changing and removing a share”- The annotations cannot be changed. To point the claim at another share or Secret, delete the claim and create it again.
- Deleting the claim, or its namespace, deletes the PersistentVolume. The share and its data are untouched. Delete the share in OpenStack when you no longer need it.
- To rotate the key, add a new access rule, put its name and key in the same Secret (re-seal it if you use a SealedSecret), restart the Pods that mount the share, then delete the old rule.
Troubleshooting
Section titled “Troubleshooting”The claim is refused at admission
Section titled “The claim is refused at admission”| Message starts with | Fix |
|---|---|
A share PVC needs both the rcs.uvic.ca/share-path and the rcs.uvic.ca/share-secret annotation. | Add the missing annotation. |
rcs.uvic.ca/share-path must be the share's path from its Manila export location | Use the path from /volumes onwards, with no monitors and no trailing slash. |
A share PVC must set spec.volumeName to | Set volumeName to the value in the message, <namespace>-<claim name>. |
A share PVC must set storageClassName to "" | Set storageClassName: ''. |
A share PVC must have exactly one access mode | Use ReadWriteMany or ReadOnlyMany, not both. |
rcs.uvic.ca/share-secret must be the name of a Secret in this namespace. | The annotation holds the Secret’s name only, in lower case. |
The Secret named in rcs.uvic.ca/share-secret must exist in | Create the Secret, with both userID and userKey, in the same namespace first. A SealedSecret must have unsealed. |
spec.volumeName may name only a PersistentVolume reserved for this PVC | Another claim already uses that volume name. Choose a different claim name. |
A PVC without a StorageClass must set spec.volumeName | A claim with storageClassName: '' must name its volume. |
The rcs.uvic.ca/share-path and rcs.uvic.ca/share-secret annotations cannot be | Delete the claim and create it again. |
exceeded quota | The storage request counts against your tenant’s quota. Request 1Gi. |
The Pod stays in ContainerCreating
Section titled “The Pod stays in ContainerCreating”kubectl describe pod shows a FailedMount event ending in mount error 13 = Permission denied. The key cannot mount that path. Check that:
- the access rule is
active; userIDis the access name with noclient.prefix, anduserKeyis that rule’s key;- the
rcs.uvic.ca/share-pathannotation is this share’s path. Each key mounts only its own share.
Writes fail
Section titled “Writes fail”| Error | Cause |
|---|---|
Permission denied | The share’s top directory is not owned by the user your Pod runs as (step 3), or the access rule is read-only. |
Permission denied under a subPath | The sub-folder did not exist, so the kubelet created it owned by root (step 6). Change its owner from a VM. |
Read-only file system | The claim is ReadOnlyMany, or the volume is mounted with readOnly: true. |