5.2.2. 単一マスター、複数 etcd、および複数ノード
以下の表は、単一マスター、3 つの etcd ホスト、ユーザーアプリケーションをホストする 2 つのノード、専用インフラストラクチャー をホストする node-role.kubernetes.io/infra=true ラベル付きの 2 つのノードの環境の例を示しています。
| ホスト名 | インストールするインフラストラクチャー/ロール |
|---|---|
| master.example.com | マスターおよびノード |
| etcd1.example.com | etcd |
| etcd2.example.com | |
| etcd3.example.com | |
| node1.example.com | コンピュートノード |
| node2.example.com | |
| infra-node1.example.com | 専用インフラストラクチャーノード |
| infra-node2.example.com |
これらのサンプルホストは、以下のサンプルインベントリーファイルの [masters]、[nodes]、および [etcd] セクションに記載されています。
単一マスター、複数 etcd、および複数ノードのインベントリーファイル
# Create an OSEv3 group that contains the masters, nodes, and etcd groups
[OSEv3:children]
masters
nodes
etcd
# Set variables common for all OSEv3 hosts
[OSEv3:vars]
ansible_ssh_user=root
openshift_deployment_type=openshift-enterprise
# 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]
master.example.com
# host group for etcd
[etcd]
etcd1.example.com
etcd2.example.com
etcd3.example.com
# host group for nodes, includes region info
[nodes]
master.example.com openshift_node_group_name='node-config-master'
node1.example.com openshift_node_group_name='node-config-compute'
node2.example.com openshift_node_group_name='node-config-compute'
infra-node1.example.com openshift_node_group_name='node-config-infra'
infra-node2.example.com openshift_node_group_name='node-config-infra'
ノードホストラベルの設定 を参照し、OpenShift Container Platform 3.9 以降のデフォルトノードセレクター要件とノードラベルに関する考慮事項を確認してください。
この例を使用するには、お使いの環境と仕様に合わせてファイルを変更し、これを /etc/ansible/hosts として保存します。