6.6. 分割和单个镜像服务 API 布局
默认情况下,Image 服务(glance)有一个 分割
部署类型:
- 外部 API 服务,该服务可通过 Identity 服务(keystone)的公共和管理员端点访问。
- 内部 API 服务,只能通过 Identity 服务的内部端点访问
对于 NFS 或 文件
后端,分割
部署类型无效,因为不同的 pod 访问同一文件共享。在配置 NFS 或 文件
后端时,您必须在 OpenStackControlPlane
CR 中将 类型设置为
single
。
分割布局示例
在以下示例中,边缘部署中的 分割
布局类型,两个 glanceAPI
实例部署在可用区(AZ)中,以满足 AZ 中的不同工作负载。
... spec: glance: template: customServiceConfig: | [DEFAULT] ... keystoneEndpoint: api0 glanceAPIs: api0: customServiceConfig: | [DEFAULT] enabled_backends = default_backend:rbd replicas: 1 type: split api1: customServiceConfig: | [DEFAULT] enabled_backends = default_backend:swift replicas: 1 type: split ...
单布局示例
在以下示例中,在 NFS 后端配置中 单个
布局类型,不同的 pod 访问同一文件共享:
... spec: extraMounts: ... glance: template: glanceAPIs: default: type: single replicas: 3 # Configure back end; set to 3 when deploying service ... customServiceConfig: | [DEFAULT] enabled_backends = default_backend:file [glance_store] default_backend = default_backend [default_backend] filesystem_store_datadir = /var/lib/glance/images databaseInstance: openstack glanceAPIs: ...
+ * 将 副本设置为
3
以实现跨 API 的高可用性。