148422597X Kubernetes Management Design Patterns [Vohra 2017-01-29] {E559F6BB}

marco.cirilli
from marco.cirilli More from this publisher
19.06.2021 Views

Chapter 15 ■ Using an HA Master with OpenShiftFigure 15-10. The /etc/ansible/hosts fileSeveral other cluster variables are supported (see Table 2. Cluster Variables at https://docs.openshift.org/latest/install_config/install/advanced_install.html#multiple-masters), butwe have used only the minimum required. With multiple masters the HA (High Availability) methodnative is supported, which makes use of a LoadBalancer configured with [lb] host in the hosts file orpreconfigured.openshift_master_cluster_method=nativeWe shall be specifying a host for the load balancer in the /etc/ansible/hosts file. Obtain the hostnameor the Public DNS or the Public IP for the load balancer instance from the EC2 Console and specify the samein the following settings in the /etc/ansible/hosts file:openshift_master_cluster_hostname=ec2-54-226-7-241.compute-1.amazonaws.comopenshift_master_cluster_public_hostname=ec2-54-226-7-241.compute-1.amazonaws.comNext, specify the masters in the /etc/ansible/hosts file.Several host variables (see Table 1. Host Variables at the URL shown above) are supported, but we haveused only the host variables shown in Table 15-1 for the master, worker, etcd and lb.344

Chapter 15 ■ Using an HA Master with OpenShiftTable 15-1. Host VariablesHost Variable Description ExampleValueopenshift_ipopenshift_public_ipopenshift_hostnameopenshift_public_hostnamePrivate IP which may be obtainedfrom the EC2 ConsolePublic IP which may be obtainedfrom the EC2 ConsoleThe hostname for the host whichmay be obtained from the PrivateDNS in the EC2 ConsoleThe public hostname for the hostwhich may be obtained from thePublic DNS in the EC2 Console10.156.14.18354.90.107.98ip-10-156-14-183.ec2.internalec2-54-90-107-98.compute-1.amazonaws.comSimilarly configure the [etcd], [lb] and [nodes] sections. The masters are also listed in the [nodes]but made non-schedulable with openshift_schedulable set to false and have the labels added withopenshift_node_labels. The hosts settings should be similar to the following; the hostnames and IPaddress would be different for different users.[masters]ec2-54-90-107-98.compute-1.amazonaws.com openshift_ip=10.156.14.183 openshift_public_ip=54.90.107.98 openshift_hostname=ip-10-156-14-183.ec2.internal openshift_public_hostname=ec2-54-90-107-98.compute-1.amazonaws.comec2-54-221-182-68.compute-1.amazonaws.com openshift_ip=10.154.46.153 openshift_public_ip=54.221.182.68 openshift_hostname=ip-10-154-46-153.ec2.internal openshift_public_hostname=ec2-54-221-182-68.compute-1.amazonaws.com[etcd]ec2-54-160-210-253.compute-1.amazonaws.com openshift_ip=10.153.195.121 openshift_public_ip=54.160.210.253 openshift_hostname=ip-10-153-195-121.ec2.internal openshift_public_hostname=ec2-54-160-210-253.compute-1.amazonaws.com[lb]ec2-54-226-7-241.compute-1.amazonaws.com openshift_ip=10.154.38.224 openshift_public_ip=54.226.7.241 openshift_hostname=ip-10-154-38-224.ec2.internal openshift_public_hostname=ec2-54-226-7-241.compute-1.amazonaws.com[nodes]ec2-54-90-107-98.compute-1.amazonaws.com openshift_ip=10.156.14.183 openshift_public_ip=54.90.107.98 openshift_hostname=ip-10-156-14-183.ec2.internal openshift_public_hostname=ec2-54-90-107-98.compute-1.amazonaws.com openshift_node_labels="{'region':'primary', 'zone': 'east'}" openshift_schedulable=falseec2-54-221-182-68.compute-1.amazonaws.com openshift_ip=10.154.46.153 openshift_public_ip=54.221.182.68 openshift_hostname=ip-10-154-46-153.ec2.internal openshift_public_hostname=ec2-54-221-182-68.compute-1.amazonaws.com openshift_node_labels="{'region':'primary', 'zone': 'east'}" openshift_schedulable=falseec2-54-159-26-13.compute-1.amazonaws.com openshift_ip=10.113.176.99 openshift_public_ip=54.159.26.13 openshift_hostname=ip-10-113-176-99.ec2.internal openshift_public_hostname=ec2-54-159-26-13.compute-1.amazonaws.com openshift_node_labels="{'region':'primary', 'zone': 'east'}"345

Chapter 15 ■ Using an HA Master with OpenShift

Table 15-1. Host Variables

Host Variable Description ExampleValue

openshift_ip

openshift_public_ip

openshift_hostname

openshift_public_hostname

Private IP which may be obtained

from the EC2 Console

Public IP which may be obtained

from the EC2 Console

The hostname for the host which

may be obtained from the Private

DNS in the EC2 Console

The public hostname for the host

which may be obtained from the

Public DNS in the EC2 Console

10.156.14.183

54.90.107.98

ip-10-156-14-183.ec2.internal

ec2-54-90-107-98.compute-1.

amazonaws.com

Similarly configure the [etcd], [lb] and [nodes] sections. The masters are also listed in the [nodes]

but made non-schedulable with openshift_schedulable set to false and have the labels added with

openshift_node_labels. The hosts settings should be similar to the following; the hostnames and IP

address would be different for different users.

[masters]

ec2-54-90-107-98.compute-1.amazonaws.com openshift_ip=10.156.14.183 openshift_public_

ip=54.90.107.98 openshift_hostname=ip-10-156-14-183.ec2.internal openshift_public_

hostname=ec2-54-90-107-98.compute-1.amazonaws.com

ec2-54-221-182-68.compute-1.amazonaws.com openshift_ip=10.154.46.153 openshift_public_

ip=54.221.182.68 openshift_hostname=ip-10-154-46-153.ec2.internal openshift_public_

hostname=ec2-54-221-182-68.compute-1.amazonaws.com

[etcd]

ec2-54-160-210-253.compute-1.amazonaws.com openshift_ip=10.153.195.121 openshift_public_

ip=54.160.210.253 openshift_hostname=ip-10-153-195-121.ec2.internal openshift_public_

hostname=ec2-54-160-210-253.compute-1.amazonaws.com

[lb]

ec2-54-226-7-241.compute-1.amazonaws.com openshift_ip=10.154.38.224 openshift_public_

ip=54.226.7.241 openshift_hostname=ip-10-154-38-224.ec2.internal openshift_public_

hostname=ec2-54-226-7-241.compute-1.amazonaws.com

[nodes]

ec2-54-90-107-98.compute-1.amazonaws.com openshift_ip=10.156.14.183 openshift_public_

ip=54.90.107.98 openshift_hostname=ip-10-156-14-183.ec2.internal openshift_public_

hostname=ec2-54-90-107-98.compute-1.amazonaws.com openshift_node_labels="{'region':

'primary', 'zone': 'east'}" openshift_schedulable=false

ec2-54-221-182-68.compute-1.amazonaws.com openshift_ip=10.154.46.153 openshift_public_

ip=54.221.182.68 openshift_hostname=ip-10-154-46-153.ec2.internal openshift_public_

hostname=ec2-54-221-182-68.compute-1.amazonaws.com openshift_node_labels="{'region':

'primary', 'zone': 'east'}" openshift_schedulable=false

ec2-54-159-26-13.compute-1.amazonaws.com openshift_ip=10.113.176.99 openshift_public_

ip=54.159.26.13 openshift_hostname=ip-10-113-176-99.ec2.internal openshift_public_

hostname=ec2-54-159-26-13.compute-1.amazonaws.com openshift_node_labels="{'region':

'primary', 'zone': 'east'}"

345

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!