CephClient CRD
Rook allows creation and updating clients through the custom resource definitions (CRDs). For more information about user management and capabilities see the Ceph docs.
Use Case: Connecting to Ceph¶
Use Client CRD in case you want to integrate Rook with applications that are using LibRBD directly. For example for OpenStack deployment with Ceph backend use Client CRD to create OpenStack services users.
The Client CRD is not needed for Flex or CSI driver users. The drivers create the needed users automatically.
Prerequisites¶
This guide assumes you have created a Rook cluster as explained in the main Quickstart guide.
1. Creating Ceph User¶
To get you started, here is a simple example of a CRD to configure a Ceph client with capabilities.
To use CephClient
to connect to a Ceph cluster:
2. Find the generated secret for the CephClient
¶
Once your CephClient
has been processed by Rook, it will be updated to include your secret:
3. Extract Ceph cluster credentials from the generated secret¶
Extract Ceph cluster credentials from the generated secret (note that the subkey will be your original client name):
The base64 encoded value that is returned is the password for your ceph client.
4. Retrieve the mon endpoints¶
To send writes to the cluster, you must retrieve the mons in use:
This command should produce a line that looks somewhat like this:
5. (optional) Generate Ceph configuration files¶
If you choose to generate files for Ceph to use you will need to generate the following files:
- General configuration file (ex.
ceph.conf
) - Keyring file (ex.
ceph.keyring
)
Examples of the files follow:
ceph.conf
ceph.keyring
6. Connect to the Ceph cluster with your given client ID¶
With the files we've created, you should be able to query the cluster by setting Ceph ENV variables and running ceph status
:
With this config, the ceph tools (ceph
CLI, in-program access, etc) can connect to and utilize the Ceph cluster.
Use Case: SQLite¶
The Ceph project contains a SQLite VFS that interacts with RBD directly, called libcephsqlite
.
First, on your workload ensure that you have the appropriate packages installed that make libcephsqlite.so
available:
Without the appropriate package (or a from-scratch build of SQLite), you will be unable to load libcephsqlite.so
.
After creating a CephClient
similar to deploy/examples/sqlitevfs-client.yaml
and retrieving it's credentials, you may set the following ENV variables:
Then start your SQLite database:
If those lines complete without error, you have successfully set up SQLite to access Ceph.
See the libcephsqlite documentation for more information on the file URL format.