From 949897fd410ba74600fd44d2e81cef638b6f5a6c Mon Sep 17 00:00:00 2001 From: Tomas Sedovic Date: Tue, 28 Nov 2017 08:40:23 +0100 Subject: Use IP addresses for OpenStack nodes Unlike other cloud providers, OpenStack VMs are not able to resolve each other by their names. If you try to run the playbooks against nodes without a pre-created /etc/hosts or a DNS that provides the hostname/ip resolution, it will fail. By setting the `openshift_hostname` variable to each node's IP address, we're able to deploy a functional cluster without running a custom DNS. It is still possible to provide an external server with nsupdate keys and have it be populated, but that is no longer a hard requirement. --- playbooks/openstack/advanced-configuration.md | 56 +++++++++++++-------------- 1 file changed, 27 insertions(+), 29 deletions(-) (limited to 'playbooks/openstack/advanced-configuration.md') diff --git a/playbooks/openstack/advanced-configuration.md b/playbooks/openstack/advanced-configuration.md index 90cc20b98..03f9c84cc 100644 --- a/playbooks/openstack/advanced-configuration.md +++ b/playbooks/openstack/advanced-configuration.md @@ -47,44 +47,42 @@ Otherwise, even if there are differences between the two versions, installation ## Accessing the OpenShift Cluster -### Use the Cluster DNS +### Configure DNS -In addition to the OpenShift nodes, we created a DNS server with all -the necessary entries. We will configure your *Ansible host* to use -this new DNS and talk to the deployed OpenShift. +OpenShift requires two DNS records to function fully. The first one poinst to +the master/load balancer and provides the UI/API access. The other one is a +wildcard domain that resolves app route requests to the infra node. -First, get the DNS IP address: +If you followed the default installation from the README section, there is no +DNS configured. We can add two entries to your `/etc/hosts` to do a quick +validation. A real deployment will however require a DNS server with the +following entries set. -```bash -$ openstack server show dns-0.openshift.example.com --format value --column addresses -openshift-ansible-openshift.example.com-net=192.168.99.11, 10.40.128.129 -``` - -Note the floating IP address (it's `10.40.128.129` in this case) -- if -you're not sure, try pinging them both -- it's the one that responds -to pings. +First, run the `openstack server list` command and note the floating IP +addresses of the *master* and *infra* nodes (we will use `10.40.128.130` for +master and `10.40.128.134` for infra here). -Next, edit your `/etc/resolv.conf` as root and put `nameserver DNS_IP` as your -**first entry**. - -If your `/etc/resolv.conf` currently looks like this: +Then add the following entries to your `/etc/hosts`: ``` -; generated by /usr/sbin/dhclient-script -search openstacklocal -nameserver 192.168.0.3 -nameserver 192.168.0.2 +10.40.128.130 console.openshift.example.com +10.40.128.134 cakephp-mysql-example-test.apps.openshift.example.com ``` -Change it to this: +I.e. point the cluster domain (as defined in the +`openshift_master_cluster_public_hostname` Ansible variable in `OSEv3`) to the +master node and any routes for deployed apps to the infra node. + +If you deploy another app, it will end up with a different URL (e.g. +myapp-test.apps.openshift.example.com) and you will need to add that too. This +is why a real deployment should always run a DNS where the second entry will be +a wildcard `*.apps.openshift.example.com). + +This will be sufficient to validate the cluster here. + +Take a look at the [External DNS](#dns-configuration-variables) section for +configuring a DNS service. -``` -; generated by /usr/sbin/dhclient-script -search openstacklocal -nameserver 10.40.128.129 -nameserver 192.168.0.3 -nameserver 192.168.0.2 -``` ### Get the `oc` Client -- cgit v1.2.3 From 847996632a0f631b95216e6708db04b2c04e1019 Mon Sep 17 00:00:00 2001 From: Tomas Sedovic Date: Wed, 29 Nov 2017 14:34:22 +0100 Subject: Update the doc text --- playbooks/openstack/advanced-configuration.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'playbooks/openstack/advanced-configuration.md') diff --git a/playbooks/openstack/advanced-configuration.md b/playbooks/openstack/advanced-configuration.md index 03f9c84cc..c0bdf5020 100644 --- a/playbooks/openstack/advanced-configuration.md +++ b/playbooks/openstack/advanced-configuration.md @@ -49,14 +49,14 @@ Otherwise, even if there are differences between the two versions, installation ### Configure DNS -OpenShift requires two DNS records to function fully. The first one poinst to +OpenShift requires two DNS records to function fully. The first one points to the master/load balancer and provides the UI/API access. The other one is a wildcard domain that resolves app route requests to the infra node. If you followed the default installation from the README section, there is no -DNS configured. We can add two entries to your `/etc/hosts` to do a quick -validation. A real deployment will however require a DNS server with the -following entries set. +DNS configured. You should add two entries to the `/etc/hosts` file on the +Ansible host (where you to do a quick validation. A real deployment will +however require a DNS server with the following entries set. First, run the `openstack server list` command and note the floating IP addresses of the *master* and *infra* nodes (we will use `10.40.128.130` for @@ -69,7 +69,7 @@ Then add the following entries to your `/etc/hosts`: 10.40.128.134 cakephp-mysql-example-test.apps.openshift.example.com ``` -I.e. point the cluster domain (as defined in the +This points the cluster domain (as defined in the `openshift_master_cluster_public_hostname` Ansible variable in `OSEv3`) to the master node and any routes for deployed apps to the infra node. -- cgit v1.2.3