Questo contenuto non è disponibile nella lingua selezionata.
Chapter 5. Example Inventory Files
5.1. Overview Copia collegamentoCollegamento copiato negli appunti!
After getting to know the basics of configuring your own inventory file, you can review the following example inventories which describe various environment topographies, including using multiple masters for high availability. You can choose an example that matches your requirements, modify it to match your own environment, and use it as your inventory file when running the installation.
The following example inventories use the default set of node groups when setting openshift_node_group_name
per host in the [nodes]
group. To define and use your own custom node group definitions, set the openshift_node_groups
variable in the inventory file. See Defining Node Groups and Host Mappings for details.
5.2. Single Master Examples Copia collegamentoCollegamento copiato negli appunti!
You can configure an environment with a single master and multiple nodes, and either a single or multiple number of etcd hosts.
Moving from a single master cluster to multiple masters after installation is not supported.
5.2.1. Single Master, Single etcd, and Multiple Nodes Copia collegamentoCollegamento copiato negli appunti!
The following table describes an example environment for a single master (with a single etcd instance running as a static pod on the same host), two nodes for hosting user applications, and two nodes with the node-role.kubernetes.io/infra=true
label for hosting dedicated infrastructure:
Host Name | Component/Role(s) to Install |
---|---|
master.example.com | Master, etcd, and node |
node1.example.com | Compute node |
node2.example.com | |
infra-node1.example.com | Infrastructure node |
infra-node2.example.com |
You can see these example hosts present in the [masters], [etcd], and [nodes] sections of the following example inventory file:
Single Master, Single etcd, and Multiple Nodes Inventory File
See Configuring Node Host Labels to ensure you understand the default node selector requirements and node label considerations beginning in OpenShift Container Platform 3.9.
To use this example, modify the file to match your environment and specifications, and save it as /etc/ansible/hosts.
5.2.2. Single Master, Multiple etcd, and Multiple Nodes Copia collegamentoCollegamento copiato negli appunti!
The following table describes an example environment for a single master, three etcd hosts, two nodes for hosting user applications, and two nodes with the node-role.kubernetes.io/infra=true
label for hosting dedicated infrastructure:
Host Name | Component/Role(s) to Install |
---|---|
master.example.com | Master and node |
etcd1.example.com | etcd |
etcd2.example.com | |
etcd3.example.com | |
node1.example.com | Compute node |
node2.example.com | |
infra-node1.example.com | Dedicated infrastructure node |
infra-node2.example.com |
You can see these example hosts present in the [masters], [nodes], and [etcd] sections of the following example inventory file:
Single Master, Multiple etcd, and Multiple Nodes Inventory File
See Configuring Node Host Labels to ensure you understand the default node selector requirements and node label considerations beginning in OpenShift Container Platform 3.9.
To use this example, modify the file to match your environment and specifications, and save it as /etc/ansible/hosts.
5.3. Multiple Masters Examples Copia collegamentoCollegamento copiato negli appunti!
You can configure an environment with multiple masters, multiple etcd hosts, and multiple nodes. Configuring multiple masters for high availability (HA) ensures that the cluster has no single point of failure.
Moving from a single master cluster to multiple masters after installation is not supported.
When configuring multiple masters, the cluster installation process supports the native
high availability (HA) method. This method leverages the native HA master capabilities built into OpenShift Container Platform and can be combined with any load balancing solution.
If a host is defined in the [lb] section of the inventory file, Ansible installs and configures HAProxy automatically as the load balancing solution for the masters. If no host is defined, it is assumed you have pre-configured an external load balancing solution of your choice to balance the master API (port 8443) on all master hosts.
This HAProxy load balancer is intended to demonstrate the API server’s HA mode and is not recommended for production environments. If you are deploying to a cloud provider, Red Hat recommends deploying a cloud-native TCP-based load balancer or take other steps to provide a highly available load balancer.
The HAProxy load balancer is only used to load balance traffic to the API server and does not load balance any user application traffic.
For an external load balancing solution, you must have:
- A pre-created load balancer virtual IP (VIP) configured for SSL passthrough.
-
A VIP listening on the port specified by the
openshift_master_api_port
value (8443 by default) and proxying back to all master hosts on that port. A domain name for VIP registered in DNS.
-
The domain name will become the value of both
openshift_master_cluster_public_hostname
andopenshift_master_cluster_hostname
in the OpenShift Container Platform installer.
-
The domain name will become the value of both
See the External Load Balancer Integrations example in Github for more information. For more on the high availability master architecture, see Kubernetes Infrastructure.
The cluster installation process does not currently support multiple HAProxy load balancers in an active-passive setup. See the Load Balancer Administration documentation for post-installation amendments.
To configure multiple masters, refer to Multiple Masters with Multiple etcd
5.3.1. Multiple Masters Using Native HA with External Clustered etcd Copia collegamentoCollegamento copiato negli appunti!
The following describes an example environment for three masters using the native
HA method:, one HAProxy load balancer, three etcd hosts, two nodes for hosting user applications, and two nodes with the node-role.kubernetes.io/infra=true
label for hosting dedicated infrastructure:
Host Name | Component/Role(s) to Install |
---|---|
master1.example.com | Master (clustered using native HA) and node |
master2.example.com | |
master3.example.com | |
lb.example.com | HAProxy to load balance only API master endpoints |
etcd1.example.com | etcd |
etcd2.example.com | |
etcd3.example.com | |
node1.example.com | Compute node |
node2.example.com | |
infra-node1.example.com | Dedicated infrastructure node |
infra-node2.example.com |
You can see these example hosts present in the [masters], [etcd], [lb], and [nodes] sections of the following example inventory file:
Multiple Masters Using HAProxy Inventory File
See Configuring Node Host Labels to ensure you understand the default node selector requirements and node label considerations beginning in OpenShift Container Platform 3.9.
To use this example, modify the file to match your environment and specifications, and save it as /etc/ansible/hosts.
5.3.2. Multiple Masters Using Native HA with Co-located Clustered etcd Copia collegamentoCollegamento copiato negli appunti!
The following describes an example environment for three masters using the native
HA method (with etcd running as a static pod on each host), one HAProxy load balancer, two nodes for hosting user applications, and two nodes with the node-role.kubernetes.io/infra=true
label for hosting dedicated infrastructure:
Host Name | Component/Role(s) to Install |
---|---|
master1.example.com | Master (clustered using native HA) and node with etcd running as a static pod on each host |
master2.example.com | |
master3.example.com | |
lb.example.com | HAProxy to load balance only API master endpoints |
node1.example.com | Compute node |
node2.example.com | |
infra-node1.example.com | Dedicated infrastructure node |
infra-node2.example.com |
You can see these example hosts present in the [masters], [etcd], [lb], and [nodes] sections of the following example inventory file:
See Configuring Node Host Labels to ensure you understand the default node selector requirements and node label considerations beginning in OpenShift Container Platform 3.9.
To use this example, modify the file to match your environment and specifications, and save it as /etc/ansible/hosts.