Manage Ceph RBD or CephFS clients#
The CephDeployment custom resource (CR) allows managing custom Ceph RADOS Block Device (RBD)
or Ceph File System (CephFS) clients. This section describes how to create,
access, and remove Ceph RBD or CephFS clients.
For all supported parameters of Ceph clients, refer to CephDeployment: Clients parameters.
Create an RBD or CephFS client#
-
Edit the
CephDeploymentCR by adding a new Ceph client to thespecsection:kubectl -n pelagia edit cephdplExample of adding an RBD client to the
kubernetes-ssdpool:spec: clients: - name: rbd-client caps: mon: allow r, allow command "osd blacklist" osd: profile rbd pool=kubernetes-ssdExample of adding a CephFS client to the
cephfs-1Ceph File System:spec: clients: - name: cephfs-1-client caps: mds: allow rw mon: allow r, allow command "osd blacklist" osd: allow rw tag cephfs data=cephfs-1 metadata=*For details about
caps, refer to Ceph documentation: Authorization (capabilities). -
Wait for created clients to become ready in the
CephDeploymentHealthCR status:kubectl -n pelagia get cephdeploymenthealth -o yamlExample output:
status: healthReport: rookCephObjects: cephClients: rbd-client: info: secretName: rook-ceph-client-rbd-client observedGeneration: 1 phase: Ready cephfs-1-client: info: secretName: rook-ceph-client-cephfs-1-client observedGeneration: 1 phase: Ready
Access data using an RBD or CephFS client#
-
Using the
CephDeploymentSecretstatus, obtainsecretInfowith the Ceph client credentials:kubectl -n pelagia get cephdeploymentsecret -o yamlExample output:
status: secretInfo: clientSecrets: - name: client.rbd-client secretName: rook-ceph-client-rbd-client secretNamespace: rook-ceph - name: client.cephfs-1-client secretName: rook-ceph-client-cephfs-1-client secretNamespace: rook-ceph -
Use
secretNameandsecretNamespaceto access the Ceph client credentials:kubectl -n <secretNamespace> get secret <secretName> -o jsonpath='{.data.<clientName>}' | base64 -d; echoSubstitute the following parameters:
<secretNamespace>withsecretNamespacefrom the previous step;<secretName>withsecretNamefrom the previous step;<clientName>with the Ceph RBD or CephFS client name set inspec.clientstheCephDeploymentresource, for example,rbd-client.
Example output:
AQAGHDNjxWYXJhAAjafCn3EtC6KgzgI1x4XDlg== -
Using the obtained credentials, create two configuration files on the required workloads to connect them with Ceph pools or file systems:
-
/etc/ceph/ceph.conf:[default] mon_host = <mon1IP>:6789,<mon2IP>:6789,...,<monNIP>:6789where
mon_hostare the comma-separated IP addresses with6789ports of the current Ceph Monitors. For example,10.10.0.145:6789,10.10.0.153:6789,10.10.0.235:6789. -
/etc/ceph/ceph.client.<clientName>.keyring:[client.<clientName>] key = <cephClientCredentials><clientName>is a client name set inspec.clientsof theCephDeploymentresource. For example,rbd-client.<cephClientCredentials>are the client credentials obtained in the previous steps. For example,AQAGHDNjxWYXJhAAjafCn3EtC6KgzgI1x4XDlg==.
-
-
If the client
capsparameters containmon: allow r, verify the client access using the following command:ceph -n client.<clientName> -s
Remove an RBD or CephFS client#
-
Edit the
CephDeploymentCR by removing the Ceph client fromspec.clients:kubectl -n pelagia edit cephdpl -
Wait for the client to be removed from the
CephDeploymentstatus instatus.healthReport.rookCephObjects.cephClients:kubectl -n pelagia get cephdeploymenthealth -o yaml