Create a StorageClass: Ceph object storage (Alpha)
Ceph object storage can provide storage access for platforms based on the Container Object Storage Interface (COSI), and provide massive and flexible Ceph object storage services, suitable for scenarios such as big data, backup and recovery, and machine learning.
Explanation of nouns
| Term | Full Name | Description |
|---|---|---|
| COSI | Container Object Storage Interface | Container Object Storage Interface aims to be a common abstraction layer across multiple object storage providers, dynamically providing object storage services to workloads. Third-party storage vendors can also use COSI to write plugins, exposing new storage systems in Kubernetes without modifying the core code. |
Prerequisites
Prepare Ceph distributed storage service in advance using any of the following methods:
-
Use the internal Ceph distributed storage service on the platform, please refer to Creating Storage Service for details.
-
Use an external Ceph distributed storage service.
Procedure of operation
Deploy the container object storage interface plugin
To use the object storage feature, you need to first deploy the Container Object Storage Interface (COSI) plugin.
-
In the left navigation pane, click Clusters > Cluster of clusters.
-
Click on the name of the cluster where the component to be deployed is located.
-
On the Plugins tab, click on the
> Deployments button next to Container Object Storage Interface. -
Wait for the deployment status to be Deployment Successful to complete the deployment.
Deploy the volume plugin
-
On the left navigation bar, click Storage > ObjectStorageClass.
-
Click on Create Object StorageClass.
-
Click on the Deploy on the Ceph Object Storage card to navigate to the corresponding cluster Plugin deployment page.
-
Click on the Ceph Object Storage Volume Plugin on the right side of the page, then click on Deploy.
-
Fill in the Access Address with the
Access Addressfrom Get Information . -
Click on Create.
-
Integrating external Ceph object storage with the platform: Click Create, enter the values of
accesskeyandsecretkeyfrom Integrating external Ceph object storage with the platform into the corresponding VALUE fields for ACCESSKEY and SECRETKEY, respectively. Click Create and choose to use this secret. -
Integration with internal Ceph object storage: Create a secret dictionary named ceph-cosi-ops-secret following the instructions in Integration with internal Ceph object storage , and choose to use this secret dictionary.
-
-
Click on Deploy.
Create a StorageClass
-
In the left navigation pane, click Storage > ObjectStorageClass.
-
Click Create Object StorageClass.
Note: The following content is provided as an example using a form, but you can also choose to use the “YAML Create” option to complete the operation.
-
Select Ceph Object Storage and click Next.
-
Refer to the following instructions to configure some parameters.
Parameter Description Recycle Strategy The recycling strategy for the storage bucket. The default strategy is delete, which means that when the storage bucket declaration is deleted, the bound storage bucket will also be deleted. Allocate Projects Please allocate the projects that can use this type of storage.
If there are no projects currently in need of this type of storage, you can choose not to allocate projects for now and update them later. -
Click Create.
Relevant operations
Get Info
Due to different storage locations, the methods for obtaining the access address, ACCESSKEY, and SECRETKEY are also different. Please choose one of the following methods based on your actual configuration.
-
Integrating external Ceph object storage with the platform:
-
Access Address: Contact the relevant personnel to obtain the access address of the Ceph object storage service, for example:
http://10.7.122.127:7480. -
ACCESSKEY and SECRETKEY: Contact the relevant personnel to obtain the
accesskeyandsecretkeywith administrator privileges.
-
-
Integration with internal Ceph object storage:
-
Access Address: Fill in the Internal Address obtained in the View Object Storage Pool Address step, for example:
http://10.7.122.127:7480. -
Secret: In the CLI tool of the cluster where the Ceph Object Storage Volume Plugin is deployed, create a secret dictionary named ceph-cosi-ops-secret with the following six commands and save the relevant key information.
kubectl patch csv -n rook-ceph $(kubectl get csv -n rook-ceph | grep -vi name | awk '{print $1}') --type=json -p='[{"op": "replace", "path": "/spec/install/spec/deployments/1/spec/replicas", "value": 1}]'kubectl exec -ti -n rook-ceph $(kubectl get pod -n rook-ceph | grep tools | awk '{print $1}') -- radosgw-admin user create --uid cosi-ops --display-name "cosi ops user" --caps "buckets=*;users=*;usage=read;metadata=read;zone=read"export ACCESS_KEY=$(kubectl exec -ti -n rook-ceph $(kubectl get pod -n rook-ceph | grep tools | awk '{print $1}') -- radosgw-admin user info --uid=cosi-ops | grep access_key | awk '{print $2}' | sed 's/"//g' | sed 's/,//g')export SECRET_KEY=$(kubectl exec -ti -n rook-ceph $(kubectl get pod -n rook-ceph | grep tools | awk '{print $1}') -- radosgw-admin user info --uid=cosi-ops | grep secret_key | awk '{print $2}' | sed 's/"//g' | sed 's/,//g')kubectl create secret generic -n cpaas-system ceph-cosi-ops-secret --from-literal=ACCESSKEY=$ACCESS_KEY --from-literal=SECRETKEY=$SECRET_KEYkubectl -n cpaas-system label secret ceph-cosi-ops-secret cosi-driver-ops=true
-