Skip to content

Commit 9f1a61c

Browse files
Merge pull request #115 from fmount/ceph_cleanup
Remove the old Ceph section from cinder.conf
2 parents ad6adb4 + beaba3c commit 9f1a61c

2 files changed

Lines changed: 88 additions & 39 deletions

File tree

‎README.md‎

Lines changed: 88 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -44,15 +44,62 @@ make undeploy
4444

4545
### Configure Cinder with Ceph backend
4646

47-
The Cinder spec API can be used to configure and customize the Ceph backend. In
48-
particular, the `customServiceConfig` parameter should be used, for each
49-
defined volume, to override the `enabled_backends` parameter, which must exist
50-
in `cinder.conf` to make the `cinderVolume` pod run. The global `cephBackend`
51-
parameter is used to specify the Ceph client-related "key/value" pairs required
52-
to connect the service with an external Ceph cluster. Multiple external Ceph
53-
clusters are not supported at the moment. The following represents an example
54-
of the Cinder object that can be used to trigger the Cinder service deployment,
55-
and enable the Cinder backend that points to an external Ceph cluster.
47+
The Cinder services can be configured to interact with an external Ceph cluster.
48+
In particular, the `customServiceConfig` parameter must be used, for each defined
49+
`cinder-volume` and `cinder-backup` instance, to override the `enabled_backends`
50+
parameter and inject the Ceph related parameters.
51+
The `ceph.conf` and the `client keyring` must exist as secrets, and can be
52+
mounted by the cinder pods using the `extraMounts` feature.
53+
54+
Create a secret by generating the following file and then apply it using the `oc`
55+
cli.
56+
57+
---
58+
apiVersion: v1
59+
kind: Secret
60+
metadata:
61+
name: ceph-client-conf
62+
namespace: openstack
63+
stringData:
64+
ceph.client.openstack.keyring: |
65+
[client.openstack]
66+
key = <secret key>
67+
caps mgr = "allow *"
68+
caps mon = "profile rbd"
69+
caps osd = "profile rbd pool=images"
70+
ceph.conf: |
71+
[global]
72+
fsid = 7a1719e8-9c59-49e2-ae2b-d7eb08c695d4
73+
mon_host = 10.1.1.2,10.1.1.3,10.1.1.4
74+
75+
76+
Add the following to the spec of the Cinder CR and then apply it using the `oc`
77+
cli.
78+
79+
```
80+
extraMounts:
81+
- name: v1
82+
region: r1
83+
extraVol:
84+
- propagation:
85+
- CinderVolume
86+
- CinderBackup
87+
volumes:
88+
- name: ceph
89+
projected:
90+
sources:
91+
- secret:
92+
name: ceph-client-conf
93+
mounts:
94+
- name: ceph
95+
mountPath: "/etc/ceph"
96+
readOnly: true
97+
```
98+
99+
The following represents an example of the entire Cinder object that can be used
100+
to trigger the Cinder service deployment, and enable the Cinder backend that
101+
points to an external Ceph cluster.
102+
56103

57104
```
58105
apiVersion: cinder.openstack.org/v1beta1
@@ -73,6 +120,11 @@ spec:
73120
cinderBackup:
74121
replicas: 1
75122
containerImage: quay.io/tripleowallabycentos9/openstack-cinder-backup:current-tripleo
123+
customServiceConfig: |
124+
[DEFAULT]
125+
backup_driver = cinder.backup.drivers.ceph.CephBackupDriver
126+
backup_ceph_pool = backups
127+
backup_ceph_user = admin
76128
secret: cinder-secret
77129
cinderVolumes:
78130
volume1:
@@ -81,29 +133,35 @@ spec:
81133
customServiceConfig: |
82134
[DEFAULT]
83135
enabled_backends=ceph
84-
cephBackend:
85-
cephFsid: <CephClusterFSID>
86-
cephMons: <CephMons>
87-
cephClientKey: <cephClientKey>
88-
cephUser: openstack
89-
cephPools:
90-
cinder:
91-
name: volumes
92-
nova:
93-
name: vms
94-
glance:
95-
name: images
96-
cinder_backup:
97-
name: backup
98-
extra_pool1:
99-
name: ceph_ssd_tier
100-
extra_pool2:
101-
name: ceph_nvme_tier
102-
extra_pool3:
103-
name: ceph_hdd_tier
136+
[ceph]
137+
volume_backend_name=ceph
138+
volume_driver=cinder.volume.drivers.rbd.RBDDriver
139+
rbd_ceph_conf=/etc/ceph/ceph.conf
140+
rbd_user=admin
141+
rbd_pool=volumes
142+
rbd_flatten_volume_from_snapshot=False
143+
rbd_secret_uuid=<Ceph_FSID>
144+
extraMounts:
145+
- name: cephfiles
146+
region: r1
147+
extraVol:
148+
- propagation:
149+
- CinderVolume
150+
- CinderBackup
151+
extraVolType: Ceph
152+
volumes:
153+
- name: ceph
154+
projected:
155+
sources:
156+
- secret:
157+
name: ceph-client-files
158+
mounts:
159+
- name: ceph
160+
mountPath: "/etc/ceph"
161+
readOnly: true
104162
```
105163

106-
When the service is up and running, it's possible to interact with the cinder
164+
When the service is up and running, it's possible to interact with the Cinder
107165
API and create the Ceph `cinder type` backend which is associated with the Ceph
108166
tier specified in the config file.
109167

‎templates/cinder/config/cinder.conf‎

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -95,12 +95,3 @@ lock_path = /var/locks/openstack/os-brick
9595
#volume_backend_name=nfs
9696
#volume_driver=cinder.volume.drivers.nfs.NfsDriver
9797
#nfs_shares_config=/etc/cinder/nfs_shares
98-
99-
[ceph]
100-
volume_backend_name=ceph
101-
volume_driver=cinder.volume.drivers.rbd.RBDDriver
102-
rbd_ceph_conf=/etc/ceph/ceph.conf
103-
rbd_user={{ .User }}
104-
rbd_pool={{ .Pool }}
105-
rbd_flatten_volume_from_snapshot=False
106-
rbd_secret_uuid={{ .ClusterFSID }}

0 commit comments

Comments
 (0)