5.2. 単一マスターの例
単一マスターと複数ノード、単一または複数の etcd ホストを含む環境を設定できます。
インストール後の単一マスタークラスターから複数マスターへの移行はサポートされていません。
5.2.1. 単一マスター、単一 etcd および複数ノード
以下の表は、単一マスター (同じホストに静的 Pod として実行されている単一 etcd インスタンスがある)、ユーザーアプリケーションをホストする 2 つのノード、専用インフラストラクチャー
をホストする node-role.kubernetes.io/infra=true ラベル付きの 2 つのノードの環境の例を示しています。
ホスト名 | インストールするインフラストラクチャー/ロール |
---|---|
master.example.com | マスター、etcd、ノード |
node1.example.com | コンピュートノード |
node2.example.com | |
infra-node1.example.com | インフラストラクチャーノード |
infra-node2.example.com |
これらのサンプルホストは、以下のサンプルインベントリーファイルの [masters]、[etcd]、および [nodes] セクションに記載されています。
単一マスター、単一 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] # SSH user, this user should allow ssh based auth without requiring a password ansible_ssh_user=root # If ansible_ssh_user is not root, ansible_become must be set to true #ansible_become=true 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] master.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 として保存します。