8.3. OpenShift Container レジストリーのインストール
- 最初に インストールの準備 を確認し、完全なクラスターインストールプロセスを確認します。OCR のインストールは同じプロセスを使用しますが、インベントリーファイルにいくつかの特定の設定が必要です。インストールのドキュメントには、インベントリーファイルの利用可能な Ansible 変数の総合的な一覧が記載されています。
- ホスト準備 の手順を完了します。
インベントリーファイル を /etc/ansible/hosts ディレクトリーに作成します。
重要スタンドアロン OCR をインストールするには、インベントリーファイルの
[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'
複数マスター (高可用性) スタンドアロン 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-config-compute group defaults openshift_node_groups=[{'name': 'node-config-compute', 'labels': ['node-role.kubernetes.io/compute=true'], 'edits': [{'key': 'kubeletArguments.max-pods','value': ['250']}, {'key': 'kubeletArguments.image-gc-high-threshold', 'value':['90']}, {'key': 'kubeletArguments.image-gc-low-threshold', 'value': ['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 がインストールされるようにします。
スタンドアロンの OCR をインストールします。このプロセスは、完全な クラスターインストール プロセスに似ています。
重要Ansible Playbook を実行するホストには、ホストあたり 75MiB 以上の空きメモリーがインベントリーファイルで必要になります。
新規クラスターをデプロイする前に、クラスターのディレクトリーに切り替え、prerequisites.yml Playbook を実行します。
$ cd /usr/share/ansible/openshift-ansible $ ansible-playbook [-i /path/to/inventory] \ 1 playbooks/prerequisites.yml
- 1
- インベントリーファイルが /etc/ansible/hosts ディレクトリーにない場合、
-i
およびインベントリーファイルのパスを指定します。
この Playbook は一回のみ実行する必要があります。
インストールを開始するには、Playbook ディレクトリーに切り替え、deploy_cluster.yml Playbook を実行します。
$ cd /usr/share/ansible/openshift-ansible $ ansible-playbook [-i /path/to/inventory] \ 1 playbooks/deploy_cluster.yml
- 1
- インベントリーファイルが /etc/ansible/hosts ディレクトリーにない場合、
-i
およびインベントリーファイルのパスを指定します。