1.8.5. 转换块存储服务配置
在之前的部署中,您将对所有服务使用相同的 cinder.conf 文件。要准备块存储服务(cinder)配置以采用,请将此单文件配置分成各个块存储服务的单个配置。参阅以下信息来指导您完成之前的配置:
-
确定所有块存储服务的配置是通用的,并删除在 Red Hat OpenShift Container Platform (RHOCP)中部署时可能会更改的任何部分,如
[database]部分中的连接,即[DEFAULT]部分中的transport_url和log_dir,整个[coordination]和[barbican]部分。剩余的通用配置进入customServiceConfig选项或Secret自定义资源(CR),然后在cinder: template:level 的customServiceConfigSecrets部分中使用。 -
确定是否有特定于调度程序的配置,并将其添加到
cinder: template: cinderScheduler中的customServiceConfig选项中。 -
确定是否有特定于 API 的配置,并将其添加到
cinder: template: cinderAPI中的customServiceConfig选项中。 -
如果部署了块存储服务备份,请将块存储服务备份配置选项添加到
customServiceConfig选项,或添加到cinder: template: cinderBackup:level 的customServiceConfigSecrets部分的SecretCR 中。删除[DEFAULT]部分中的主机配置,以便稍后支持多个副本。 -
确定每个驱动程序的单个卷后端配置。配置位于特定的驱动程序部分,它使用
[backend_defaults]部分和 FC zoning 部分(如果使用它们)。Block Storage Service operator 不支持所有卷服务的全局customServiceConfig选项。每个后端在cinder: template: cinderVolumes下都有自己的部分,并且配置位于customServiceConfig选项或SecretCR 中,然后在customServiceConfigSecrets部分中使用。 如果任何块存储服务卷驱动程序需要自定义厂商镜像,请在 红帽生态系统目录 中找到镜像的位置,并使用
cinderVolumes部分中的键创建或修改OpenStackVersionCR 来指定自定义镜像。例如,如果您有以下配置:
spec: cinder: enabled: true template: cinderVolume: pure: customServiceConfigSecrets: - openstack-cinder-pure-cfg < . . . >然后,描述该后端容器镜像的
OpenStackVersionCR 类似以下示例:apiVersion: core.openstack.org/v1beta1 kind: OpenStackVersion metadata: name: openstack spec: customContainerImages: cinderVolumeImages: pure: registry.connect.redhat.com/purestorage/openstack-cinder-volume-pure-rhosp-18-0'注意OpenStackVersion的名称必须与OpenStackControlPlaneCR 的名称匹配。如果您的块存储服务使用外部文件(例如,对于自定义策略),或者存储凭证或 SSL 证书颁发机构捆绑包以连接到存储阵列,请将这些文件提供给正确的容器。使用
Secrets或ConfigMap将信息存储在 RHOCP 中,然后存储在extraMounts键中。例如,对于存储在名为ceph-conf-files的Secret中的 Red Hat Ceph Storage 凭证,您可以在OpenstackControlPlaneCR 中修补顶级extraMounts密钥:spec: extraMounts: - extraVol: - extraVolType: Ceph mounts: - mountPath: /etc/ceph name: ceph readOnly: true propagation: - CinderVolume - CinderBackup - Glance volumes: - name: ceph projected: sources: - secret: name: ceph-conf-files对于特定于服务的文件,如 API 策略,您可以在服务本身中添加配置。在以下示例中,您将包含
CinderAPI配置来引用您要从名为my-cinder-conf的ConfigMap添加的策略,其具有策略键,其内容如下:spec: cinder: enabled: true template: cinderAPI: customServiceConfig: | [oslo_policy] policy_file=/etc/cinder/api/policy.yaml extraMounts: - extraVol: - extraVolType: Ceph mounts: - mountPath: /etc/cinder/api name: policy readOnly: true propagation: - CinderAPI volumes: - name: policy projected: sources: - configMap: name: my-cinder-conf items: - key: policy path: policy.yaml