Red Hat Training

A Red Hat training course is available for OpenShift Container Platform

27.3.4.2.8. 例: アプリケーション、レジストリー、ロギングおよびメトリクス用のコンバージドモード

  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'
    
    openshift_metrics_install_metrics=true
    openshift_metrics_hawkular_nodeselector={"node-role.kubernetes.io/infra": "true"} 2
    openshift_metrics_cassandra_nodeselector={"node-role.kubernetes.io/infra": "true"} 3
    openshift_metrics_heapster_nodeselector={"node-role.kubernetes.io/infra": "true"} 4
    openshift_metrics_storage_kind=dynamic
    openshift_metrics_storage_volume_size=10Gi
    openshift_metrics_cassandra_pvc_storage_class_name="glusterfs-registry-block" 5
    
    openshift_logging_install_logging=true
    openshift_logging_kibana_nodeselector={"node-role.kubernetes.io/infra": "true"} 6
    openshift_logging_curator_nodeselector={"node-role.kubernetes.io/infra": "true"} 7
    openshift_logging_es_nodeselector={"node-role.kubernetes.io/infra": "true"} 8
    openshift_logging_storage_kind=dynamic
    openshift_logging_es_pvc_size=10Gi                        9
    openshift_logging_elasticsearch_storage_type=pvc              10
    openshift_logging_es_pvc_storage_class_name="glusterfs-registry-block"       11
    
    openshift_storage_glusterfs_namespace=app-storage
    openshift_storage_glusterfs_storageclass=true
    openshift_storage_glusterfs_storageclass_default=false
    openshift_storage_glusterfs_block_deploy=true
    openshift_storage_glusterfs_block_host_vol_size=100       12
    openshift_storage_glusterfs_block_storageclass=true
    openshift_storage_glusterfs_block_storageclass_default=false
    
    openshift_storage_glusterfs_registry_namespace=infra-storage
    openshift_storage_glusterfs_registry_block_deploy=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
    1 2 3 4 6 7 8
    統合 OpenShift Container レジストリー、ロギングおよびメトリクスをインフラストラクチャーノードで実行することが推奨されます。インフラストラクチャーノードは、OpenShift Container Platform クラスターのサービスを提供するために管理者がデプロイするアプリケーションを実行する専用ノードです。
    5 11
    ロギングとメトリクスに使用する StorageClass を指定します。この名前は、ターゲットの GlusterFS クラスター (例: glusterfs-<name>-block) 名から生成されます。この例では <name>registry にデフォルト設定されています。
    9
    OpenShift ロギングでは、PVC サイズを指定する必要があります。ここで指定される値は単なる例であり、推奨される値ではありません。
    10
    永続 Elasticsearch ストレージを使用している場合は、ストレージタイプを pvc に設定します。
    12
    Glusterblock ボリュームをホストするために自動作成される GlusterFS ボリュームのサイズ (GB)。この変数は、glusterblock volume create 要求で十分な領域がない場合にのみ使用されます。この値は、glusterblock ボリュームのサイズの上限を表します。ただし、GlusterFS ブロックホスティングボリュームを手動で作成した場合は除きます。
  2. [OSEv3:children] セクションに glusterfsglusterfs_registry を追加し、[glusterfs][glusterfs_registry] グループを有効にします。

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

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

    以下に例を示します。

    [glusterfs]
    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" ]'
    
    [glusterfs_registry]
    node14.example.com glusterfs_devices='[ "/dev/xvdc", "/dev/xvdd" ]'
    node15.example.com glusterfs_devices='[ "/dev/xvdc", "/dev/xvdd" ]'
    node16.example.com glusterfs_devices='[ "/dev/xvdc", "/dev/xvdd" ]'
  4. [glusterfs][glusterfs_registry] に一覧表示されているホストを [nodes] グループに追加します。

    [nodes]
    ...
    node11.example.com openshift_node_group_name='node-config-compute'   1
    node12.example.com openshift_node_group_name='node-config-compute'   2
    node13.example.com openshift_node_group_name='node-config-compute'   3
    node14.example.com openshift_node_group_name='node-config-infra'" 4
    node15.example.com openshift_node_group_name='node-config-infra'" 5
    node16.example.com openshift_node_group_name='node-config-infra'" 6
    1 2 3 4 5 6
    各ノードには、一般的なアプリケーションまたはインフラストラクチャーアプリケーションのスケジューリングをそれらのノードで許可するかどうかを示すマークが付けられます。アプリケーションの制限方法は管理者が設定します。
    注記

    前述の手順では、インベントリーファイルに追加する必要のある一部のオプションのみを指定しています。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