4.3. 使用 Registry 以融合模式部署 Red Hat Openshift Container Storage


  1. 在清单文件中,将以下变量包含在 [OSEv3:vars] 部分中,根据您的配置需要调整它们:

    openshift_storage_glusterfs_registry_namespace=app-storage
    openshift_storage_glusterfs_registry_storageclass=true
    openshift_storage_glusterfs_registry_storageclass_default=false
    openshift_storage_glusterfs_registry_block_deploy=true
    openshift_storage_glusterfs_registry_block_host_vol_create=true
    openshift_storage_glusterfs_registry_block_host_vol_size=100
    openshift_storage_glusterfs_registry_block_storageclass=true
    openshift_storage_glusterfs_registry_block_storageclass_default=false
    Copy to Clipboard Toggle word wrap
  2. 在清单文件中,在 [OSEv3:vars] 下设置以下变量:

    [OSEv3:vars]
    ...
    openshift_hosted_registry_storage_kind=glusterfs
    openshift_hosted_registry_storage_volume_size=5Gi
    openshift_hosted_registry_selector='node-role.kubernetes.io/infra=true'
    Copy to Clipboard Toggle word wrap
  3. [OSEv3:children] 部分添加 glusterfs_registry 来启用'[glusterfs_registry]' 组:

    [OSEv3:children]
    masters
    etcd
    nodes
    glusterfs_registry
    Copy to Clipboard Toggle word wrap
  4. 添加 [glusterfs_registry] 部分,其中包含托管 GlusterFS 存储的每个存储节点的条目。对于每个节点,将 glusterfs_devices 设置为作为 GlusterFS 集群一部分完全管理的原始块设备列表。必须至少列出一个设备。每个设备都必须是空的,没有分区或 LVM PV。以以下形式指定变量:

    <hostname_or_ip> glusterfs_zone=<zone_number> glusterfs_devices='[ "</path/to/device1/>", "</path/to/device2>", ... ]'
    Copy to Clipboard Toggle word wrap

    例如:

    [glusterfs_registry]
    node106.example.com glusterfs_zone=1 glusterfs_devices='["/dev/sdd"]'
    node107.example.com glusterfs_zone=2 glusterfs_devices='["/dev/sdd"]'
    node108.example.com glusterfs_zone=3 glusterfs_devices='["/dev/sdd"]'
    Copy to Clipboard Toggle word wrap
    • [glusterfs_registry] 下列出的主机添加到 [nodes] 组中:

      [nodes]
      ...
      node106.example.com openshift_node_group_name="node-config-compute"
      node107.example.com openshift_node_group_name="node-config-compute"
      node108.example.com openshift_node_group_name="node-config-compute"
      Copy to Clipboard Toggle word wrap
  5. 前面的步骤详细说明了需要添加到一个更大的、完整的清单文件。要使用完整的清单文件来部署 {gluster},请将文件路径作为以下 playbook 的选项:

    1. 对于初始 OpenShift Container Platform 安装:

      ansible-playbook -i <path_to_inventory_file> /usr/share/ansible/openshift-ansible/playbooks/prerequisites.yml
      
      ansible-playbook -i <path_to_inventory_file> /usr/share/ansible/openshift-ansible/playbooks/deploy_cluster.yml
      Copy to Clipboard Toggle word wrap
    2. 对于在现有 OpenShift Container Platform 集群上进行独立安装:

      ansible-playbook -i <path_to_inventory_file> /usr/share/ansible/openshift-ansible/playbooks/openshift-glusterfs/config.yml
      Copy to Clipboard Toggle word wrap
  6. 要验证部署请参阅 第 4.8 节 “验证您的部署”
返回顶部
Red Hat logoGithubredditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

通过我们的产品和服务,以及可以信赖的内容,帮助红帽用户创新并实现他们的目标。 了解我们当前的更新.

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

Theme

© 2025 Red Hat