5.2. 单 master 示例
您可以使用单个 master 和多个节点配置环境,也可以配置单个或多个 etcd 主机。
在安装后从单一 master 集群移动到多个 master 集群不被支持。
5.2.1. 单 Master、单一 etcd 和多个节点 复制链接链接已复制到粘贴板!
下表描述了单个 master (单一 etcd 实例在同一主机上运行的静态 pod)、两个托管用户应用程序的 节点 以及两个具有 node-role.kubernetes.io/infra=true 标签的节点,用于托管专用基础架构的示例环境:
| 主机名 | 安装的组件/角色 |
|---|---|
| master.example.com | Master、etcd 和 node |
| node1.example.com | Compute 节点 |
| node2.example.com | |
| infra-node1.example.com | Infrastructure 节点 |
| infra-node2.example.com |
您可以看到以下清单文件的 [masters]、[etcd] 和 [nodes] 部分中出现的这些示例主机:
单个 Master、单一 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。