5.3.2. 同一の場所に配置されたクラスター化された etcd を含む、ネイティブ HA を使用した複数マスター
以下の表は、ネイティブ HA 方法を使用する 3 つの マスター
(各ホストに静的 Pod として実行される etcd がある)、1 つの HAProxy ロードバランサー、ユーザーアプリケーションをホストする 2 つのノード、専用インフラストラクチャー
をホストする node-role.kubernetes.io/infra=true ラベル付きの 2 つのノードの環境の例を示しています。
ホスト名 | インストールするインフラストラクチャー/ロール |
---|---|
master1.example.com | 各ホストに静的 Pod として実行されている etcd があるマスター (ネイティブ HA を使用するクラスター化されたマスター) とノード |
master2.example.com | |
master3.example.com | |
lb.example.com | API マスターエンドポイントの負荷分散のみの HAProxy |
node1.example.com | コンピュートノード |
node2.example.com | |
infra-node1.example.com | 専用インフラストラクチャーノード |
infra-node2.example.com |
これらのサンプルホストは、以下のサンプルインベントリーファイルの [masters]、[etcd]、[lb] および [nodes] セクションに記載されています。
# 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 # 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 # host group for masters [masters] master1.example.com master2.example.com master3.example.com # host group for etcd [etcd] master1.example.com master2.example.com master3.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' 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 として保存します。