Red Hat Training

A Red Hat training course is available for OpenShift Container Platform

第8章 OpenShift Container レジストリーのスタンドアロンデプロイメントのインストール

8.1. OpenShift Container レジストリーについて

OpenShift Container Platform は、OpenShift Container レジストリー (OCR) と呼ばれる統合コンテナーレジストリーを含む完全な機能を備えたエンタープライズソリューションです。また、OpenShift Container Platform を開発者向けの完全な PaaS 環境としてデプロイする代わりに、 OCR をスタンドアロンのコンテナーレジストリーとしてインストールし、オンプレミスまたはクラウドで実行することも可能です。

OCR のスタンドアロンデプロイメントをインストールすると、標準的な OpenShift Container Platform のインストールと同様にマスターとノードのクラスターも引き続きインストールされます。次に、コンテナーレジストリーはそのクラスター上で実行されるようにデプロイされます。このスタンドアロンデプロイメントのオプションは、コンテナーレジストリーは必要だが、開発者向けの Web コンソールやアプリケーションのビルドおよびデプロイツールを含む OpenShift Container Platform の完全な環境は必要ない、という管理者に役立ちます。

OCR には以下の機能があります。

管理者は、スタンドアロン OCR をデプロイすることで OpenShift Container Platform の複数のクラスターに対応しているレジストリーを個別に管理できます。また、スタンドアロン OCR を使うと、セキュリティーやコンプライアンスに関する独自の要件を満たすようにレジストリーを分離することも可能です。

8.2. ハードウェアの最小要件

スタンドアロン OCR をインストールするためのハードウェア要件は以下の通りです。

  • 物理または仮想システム、またはパブリックまたはプライベート IaaS で実行されるインスタンス。
  • ベース OS: RHEL 7.4、または 7.5 (RHEL 7 Extras チャンネルの「最小限の」インストールオプションおよび最新のパッケージ)、または、RHEL Atomic Host 7.4.5 以降。
  • NetworkManager 1.0 以降
  • 2 vCPU。
  • 16 GB 以上の RAM。
  • /var/ を含むファイルシステムの 15 GB 以上のハードディスク領域。
  • Docker のストレージバックエンドに使用する 15 GB 以上の追加の未割り当て領域。詳細は「Docker ストレージの設定」を参照してください。
重要

OpenShift Container Platform は x86_64 or IBM POWER アーキテクチャーを使用するサーバーをサポートします。IBM POWER サーバーを使用してクラスターホストをホストする場合は、使用できるサーバーは IBM POWER のみになります。

注記

RHEL Atomic Host の /var/ のファイルシステムのサイジング要件を満たすには、デフォルト設定を変更する必要があります。インストール時またはインストール後にこの設定を行う方法については「Managing Storage in Red Hat Enterprise Linux Atomic Host」を参照してください。

8.3. サポートされているシステムトポロジー

以下のシステムトポロジーはスタンドアロン OCR でサポートされています。

オールインワン

マスター、ノード、etcd、レジストリーの各コンポーネントを含む単一ホスト。

複数マスター (高可用性)

すべてのコンポーネント (マスター、ノード、etcd、レジストリー) がそれぞれに含まれる 3 つのホスト。マスターはネイティブの高可用性を確保するように設定されます。

8.4. ホストの準備

スタンドアロン OCR をインストールする前に、完全な OpenShift Container Platform PaaS のインストールについて取り上げたホストの準備のトピックで説明している手順と同じ手順をすべて実行する必要があります。この手順には、適切なリポジトリーへのホストの登録とサブスクライブ、特定パッケージのインストールまたは更新、Docker とそのストレージ要件のセットアップなどが含まれます。

ホストの準備 の各手順を実行し、スタンドアロンレジストリーのインストール方法に進んでください。

8.5. Ansible を使用したインストール

スタンドアロン OCR をインストールする際に、「クラスターインストール」に詳細に説明されているように Ansible を使用した OpenShift Container Platform クラスターのインストールとほぼ同じ手順を使用します。大きな違いとして、ここでは Playbook がレジストリーのインストールパスをたどれるよう、インベントリーファイルの [OSEv3:vars] セクションに deployment_subtype=registry を設定する必要があります。

以下は、サポートされている複数の異なるシステムトポロジー用のインベントリーファイルの例です。

オールインワンのスタンドアロン OpenShift Container レジストリーインベントリーファイル

# Create an OSEv3 group that contains the masters and nodes groups
[OSEv3:children]
masters
nodes
etcd

# Set variables common for all OSEv3 hosts
[OSEv3:vars]
# SSH user, this user should allow ssh based auth without requiring a password
ansible_ssh_user=root

openshift_master_default_subdomain=apps.test.example.com

# If ansible_ssh_user is not root, ansible_become must be set to true
#ansible_become=true

openshift_deployment_type=openshift-enterprise
deployment_subtype=registry 1
openshift_hosted_infra_selector="" 2

# uncomment the following to enable htpasswd authentication; defaults to DenyAllPasswordIdentityProvider
#openshift_master_identity_providers=[{'name': 'htpasswd_auth', 'login': 'true', 'challenge': 'true', 'kind': 'HTPasswdPasswordIdentityProvider'}]

# host group for masters
[masters]
registry.example.com

# host group for etcd
[etcd]
registry.example.com

# host group for nodes
[nodes]
registry.example.com openshift_node_group_name='node-config-all-in-one'

1
deployment_subtype=registry を設定して、OpenShift Container Platform 環境のすべてではなく、スタンドアロン OCR がインストールされるようにします。
2
レジストリーとその Web コンソールが単一ホストでスケジュールされることを可能にします。

複数マスター (高可用性) スタンドアロン OpenShift Container レジストリーインベントリーファイル

# Create an OSEv3 group that contains the master, nodes, etcd, and lb groups.
# The lb group lets Ansible configure HAProxy as the load balancing solution.
# Comment lb out if your load balancer is pre-configured.
[OSEv3:children]
masters
nodes
etcd
lb

# Set variables common for all OSEv3 hosts
[OSEv3:vars]
ansible_ssh_user=root
openshift_deployment_type=openshift-enterprise
deployment_subtype=registry 1

openshift_master_default_subdomain=apps.test.example.com

# Uncomment the following to enable htpasswd authentication; defaults to
# DenyAllPasswordIdentityProvider.
#openshift_master_identity_providers=[{'name': 'htpasswd_auth', 'login': 'true', 'challenge': 'true', 'kind': 'HTPasswdPasswordIdentityProvider'}]

# Native high availability cluster method with optional load balancer.
# If no lb group is defined installer assumes that a load balancer has
# been preconfigured. For installation the value of
# openshift_master_cluster_hostname must resolve to the load balancer
# or to one or all of the masters defined in the inventory if no load
# balancer is present.
openshift_master_cluster_method=native
openshift_master_cluster_hostname=openshift-internal.example.com
openshift_master_cluster_public_hostname=openshift-cluster.example.com

# apply updated node defaults
openshift_node_kubelet_args={'pods-per-core': ['10'], 'max-pods': ['250'], 'image-gc-high-threshold': ['90'], 'image-gc-low-threshold': ['80']}

# enable ntp on masters to ensure proper failover
openshift_clock_enabled=true

# host group for masters
[masters]
master1.example.com
master2.example.com
master3.example.com

# host group for etcd
[etcd]
etcd1.example.com
etcd2.example.com
etcd3.example.com

# Specify load balancer host
[lb]
lb.example.com

# host group for nodes, includes region info
[nodes]
master[1:3].example.com openshift_node_group_name='node-config-master-infra'
node1.example.com openshift_node_group_name='node-config-compute'
node2.example.com openshift_node_group_name='node-config-compute'

1
deployment_subtype=registry を設定して、OpenShift Container Platform 環境のすべてではなく、スタンドアロン OCR がインストールされるようにします。

/etc/ansible/hosts でインベントリーファイルを定義して Ansible を設定した後に、以下を実行します。

  1. prerequisites.yml Playbook を実行してベースパッケージと Docker を設定します。これは、新規クラスターをデプロイする前に 1 回だけ実行します。インベントリーファイルが /etc/ansible/hosts 以外の場所にある場合には、-i を指定して以下のコマンドを実行します。

    重要

    Ansible Playbook を実行するホストには、ホストあたり 75MiB 以上の空きメモリーがインベントリーで必要になります。

    # ansible-playbook  [-i /path/to/inventory] \
        /usr/share/ansible/openshift-ansible/playbooks/prerequisites.yml
  2. deploy_cluster.yml Playbook を実行してインストールを開始します。

    # ansible-playbook  [-i /path/to/inventory] \
        /usr/share/ansible/openshift-ansible/playbooks/deploy_cluster.yml
注記

クラスターインストールプロセスに関する詳細の使用方法 (使用可能な Ansible 変数の一覧を含む) については、「インストール計画」 から本書全体に目を通してください。