Red Hat Training

A Red Hat training course is available for OpenShift Container Platform

27.3.4.2.6. 例: 統合 OpenShift Container レジストリーを使用する接続モード

  1. インベントリーファイルの [OSEv3:vars] セクションに次の変数を追加し、設定に合わせてそれらを調整します。

    [OSEv3:vars]
    ...
    openshift_hosted_registry_storage_kind=glusterfs 1
    openshift_hosted_registry_storage_volume_size=5Gi
    openshift_hosted_registry_selector='node-role.kubernetes.io/infra=true'
    1
    統合 OpenShift Container Registry をインフラストラクチャーノードで実行することが推奨されます。インフラストラクチャーノードは、OpenShift Container Platform クラスターのサービスを提供するために管理者がデプロイするアプリケーションを実行する専用ノードです。
  2. [OSEv3:children] セクションに glusterfs_registry を追加して、[glusterfs_registry] グループを有効にします。

    [OSEv3:children]
    masters
    nodes
    glusterfs_registry
  3. GlusterFS ストレージをホストする各ストレージノードのエントリーを含む [glusterfs_registry] セクションを追加します。ノードごとに、 glusterfs_devices を GlusterFS クラスターの一部として完全に管理される raw ブロックデバイスの一覧に設定します。少なくとも 1 つのデバイスを一覧に含める必要があります。各デバイスはパーティションや LVM PV がないベアでなければなりません。変数は次の形式で指定します。

    <hostname_or_ip> glusterfs_devices='[ "</path/to/device1/>", "</path/to/device2>", ... ]'

    以下に例を示します。

    [glusterfs_registry]
    node11.example.com glusterfs_devices='[ "/dev/xvdc", "/dev/xvdd" ]'
    node12.example.com glusterfs_devices='[ "/dev/xvdc", "/dev/xvdd" ]'
    node13.example.com glusterfs_devices='[ "/dev/xvdc", "/dev/xvdd" ]'
  4. [glusterfs_registry] の下に一覧表示されているホストを [nodes] グループに追加します。

    [nodes]
    ...
    node11.example.com openshift_node_group_name="node-config-infra"
    node12.example.com openshift_node_group_name="node-config-infra"
    node13.example.com openshift_node_group_name="node-config-infra"
    注記

    前述の手順では、インベントリーファイルに追加する必要のある一部のオプションのみを指定しています。Red Hat Gluster Storage をデプロイするには、完全なインベントリーファイルを使用します。

  5. Playbook ディレクトリーに切り替え、インストール Playbook を実行します。インベントリーファイルの相対パスをオプションとして指定します。

    • OpenShift Container Platform の新規インストール:

      $ cd /usr/share/ansible/openshift-ansible
      $ ansible-playbook -i <path_to_inventory_file> playbooks/prerequisites.yml
      $ ansible-playbook -i <path_to_inventory_file> playbooks/deploy_cluster.yml
    • 既存の OpenShift Container Platform クラスターへのインストール:

      $ cd /usr/share/ansible/openshift-ansible
      $ ansible-playbook -i <path_to_inventory_file> playbooks/openshift-glusterfs/config.yml