Bug 1246458 - Need an option in ansible hosts to set node's dnsIP in node yaml config file to an external IP or empty
Summary: Need an option in ansible hosts to set node's dnsIP in node yaml config file ...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Installer
Version: 3.0.0
Hardware: Unspecified
OS: Unspecified
medium
low
Target Milestone: ---
: ---
Assignee: Andrew Butcher
QA Contact: Ma xiaoqiang
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-07-24 11:08 UTC by Johnny Liu
Modified: 2016-07-04 00:46 UTC (History)
6 users (show)

Fixed In Version: openshift-ansible-3.0.18-1.git.0.a3e601b
Doc Type: Enhancement
Doc Text:
The advanced installer now allows users to set the node configuration 'dnsIP' value which is used to specify the IP Address of the internal cluster DNS (SkyDNS). This is useful in OpenShift Enterprise 3.0 environments where the master may have multiple IP addresses and you wish to specify which address to use for cluster DNS lookups. OpenShift Enterprise 3.1 nodes perform DNS lookups via the Kubernetes Service IP ensuring that requests are load balanced across the available masters. As such nodes generally should not have dnsIP set. Users who need to set the dnsIP may now set the ansible variable 'openshift_dns_ip'.
Clone Of:
Environment:
Last Closed: 2015-12-17 21:19:16 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2015:2667 0 normal SHIPPED_LIVE Red Hat OpenShift Enterprise bug fix update 2015-12-18 02:18:50 UTC

Description Johnny Liu 2015-07-24 11:08:22 UTC
Description of problem:
Currently ansible script always set node's dnsIP to IP of the 1st master.
But in the following scenarios, such setting is not correct. e.g:
1. User already set openshift_master_embedded_dns=False, then dnsIP should be empty.
2. User have an external DNS, then dnsIP should be pointed to the external DNS.
3. User set up a multiple master env, when failover happened, the DNS service embedded in master service running on the 1st master will be transferred to the 2nd master, but dnsIP is still pointing to the IP of the 1st master, it is incorrect.

So the best resolution, allow user to configure it in ansible hosts file, and it is better show such option in in inventory/byo/hosts.example, and give some instruction about it.

Now we are releasing v3.0.1.0, seen from user's angle, this option will bring more convenience for user. Otherwise, user have to edit master(s)/node(s) config yaml file manually one by one after installation.



Version-Release number of selected component (if applicable):
https://github.com/openshift/openshift-ansible.git -b master

How reproducible:


Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:

Comment 1 Scott Dodson 2015-07-24 19:19:41 UTC
Can't this just be set by setting openshift_ip on the host.

Comment 2 Scott Dodson 2015-07-24 20:32:53 UTC
(In reply to Scott Dodson from comment #1)
> Can't this just be set by setting openshift_ip on the host.

Nevermind, this suggestion isn't valid.

Comment 3 Jason DeTiberus 2015-07-27 16:26:32 UTC
https://github.com/openshift/openshift-ansible/pull/393

Comment 4 Brenton Leanhardt 2015-07-27 17:53:14 UTC
Available for testing here as well: https://ootest-leanhardt.rhcloud.com/

Comment 5 Johnny Liu 2015-07-28 07:51:33 UTC
Manually merge PR#393 into master branch, re-test it, found #3 is fixed, but issue #1 and #2 is not fixed, so assign back.

Comment 6 Jason DeTiberus 2015-10-30 03:35:51 UTC
Andrew, this falls in line with the HA work you are already doing.  In addition, I think we should go ahead and just remove the ability to disable the embedded dns server.

Comment 7 Andrew Butcher 2015-12-03 20:20:57 UTC
This PR adds 'openshift_dns_ip' to inventory variables as a way to override node dnsIP.

https://github.com/openshift/openshift-ansible/pull/1012

Comment 8 Johnny Liu 2015-12-04 11:18:23 UTC
Re-test this bug with PR#1012, most of part are fixed, but still have some issue for pre 3.1 product.

For 3.1:
1. When openshift_dns_ip is not set in ansible host file, no "dnsIP" is set in node-config.yaml, while in user's pod, it is using kubernetes service ip as the first nameserver.
# grep dnsIP /etc/origin/node/node-config.yaml
<empty>
$ oc rsh simple-openshift-sinatra-sti-1-xy08p
bash-4.2$ cat /etc/resolv.conf
nameserver 172.30.0.1
nameserver 10.66.xx.xx
search jialiu.svc.cluster.local svc.cluster.local cluster.local cluster.local. lab.eng.nay.redhat.com
options ndots:5

2. When openshift_dns_ip is set in ansible host file (e.g: openshift_dns_ip=172.30.0.2), "dnsIP" is set in node-config.yaml, and in user's pod, it is using this user specified "dnsIP" as the first nameserver.
# grep dnsIP /etc/origin/node/node-config.yaml
dnsIP: 172.30.0.2
$ oc rsh docker-registry-1-12hh7
bash-4.2$ cat /etc/resolv.conf 
nameserver 172.30.0.2
nameserver 10.66.xx.xx
search default.svc.cluster.local svc.cluster.local cluster.local cluster.local. lab.eng.nay.redhat.com
options ndots:5


For pre 3.1 (E.g: 3.0.2 release version - openshift-3.0.2.0-0.git.38.7576bc5.el7ose.x86_64):
3. When openshift_dns_ip is not set in ansible host file, no "dnsIP" is set in node-config.yaml, while in user's pod, openshift did not use the first master ip as the first nameserver.
# grep dnsIP /etc/openshift/node/node-config.yaml
$ oc rsh docker-registry-1-q634f
bash-4.2$ cat /etc/resolv.conf 
nameserver 10.66.xx.xx     ---> the first master is not set as resolver, here the ip is node's DNS resolver.
search default.svc.cluster.local svc.cluster.local cluster.local openstacklocal lab.eng.nay.redhat.com
options ndots:5

Scenarios #3 will cause dns resolve failure, according to comments in PR#1012 - first master ip pre 3.1, its behavior is wrong.

Comment 9 Johnny Liu 2015-12-04 11:28:07 UTC
About pacemaker installation check, installation is blocked by BZ#1288481

Comment 16 Johnny Liu 2015-12-11 06:29:10 UTC
Verified this but with openshift-ansible-roles-3.0.20-1.git.0.3703f1b.el7aos.noarch, and PASS.


scenarios #3, atomic-openshift-utils from puddle + 3.0.z install, PASS
# grep dnsIP /etc/openshift/node/node-config.yaml
dnsIP: 192.168.0.32

192.168.0.32 is the 1st master IP.

$ oc rsh docker-registry-1-2gmqi
bash-4.2$ cat /etc/resolv.conf 
nameserver 192.168.0.32
nameserver xx.xx.xx.xx
search default.svc.cluster.local svc.cluster.local cluster.local openstacklocal 
options ndots:5
bash-4.2$ curl docker-registry.default.svc.cluster.local:5000
404 page not found

Comment 18 errata-xmlrpc 2015-12-17 21:19:16 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2015:2667


Note You need to log in before you can comment on or make changes to this bug.