Bug 876644

Summary: oo-register-dns is hardcoded to add entries to a BIND server at 127.0.0.1
Product: OpenShift Container Platform Reporter: Javier Peña <javier.pena>
Component: NodeAssignee: Brenton Leanhardt <bleanhar>
Status: CLOSED ERRATA QA Contact: libra bugs <libra-bugs>
Severity: low Docs Contact:
Priority: low    
Version: 1.2.0CC: bleanhar, jkeck, xjia, xtian
Target Milestone: ---Keywords: Triaged
Target Release: ---   
Hardware: Unspecified   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-01-31 20:32:47 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Javier Peña 2012-11-14 16:28:12 UTC
Description of problem:
oo-register-dns will only work when the BIND server is running on the same host as the broker node. Checking the source, it contains the following:

<snip>
command =<<-EOF
server 127.0.0.1
update delete #{node_hostname}.#{node_domain} A
update add #{node_hostname}.#{node_domain} 180 A #{ip}
send
EOF

system "nsupdate -k #{key} <<EOF\n#{command}\nEOF"

There is no configurable option for an external BIND server.


Version-Release number of selected component (if applicable):
Checked on the public mirror from 2012-10-31

How reproducible:
Always

Steps to Reproduce:
1. Setup OpenShift broker using an external DNS service
2. Run oo-register-dns --with-node-hostname node1  --with-node-ip 192.168.0.1 --domain example.com 
3.
  
Actual results:
The DNS entry add will fail.

Expected results:
The command should read the DNS server from /etc/openshift/plugins.d/openshift-origin-dns-bind.conf or have a command-line option to set it.


Additional info:

Comment 1 Luke Meyer 2012-11-14 19:58:36 UTC
Ugh. Thanks for pointing this out.

It should be really easy to generalize this.
1. At minimum, allow specifying server and key.
2. Better, pick those up from the plugin settings.
3. Best, use the plugin itself (whichever is configured) to make the update.

Comment 2 John Keck 2012-11-15 17:42:15 UTC
Scheduling for dot release.

Comment 5 Brenton Leanhardt 2012-12-11 18:39:15 UTC
The upstream pull request is here:
https://github.com/openshift/origin-server/pull/1057

This will ship with the next puddle.

Comment 6 xjia 2012-12-12 09:49:43 UTC
Verify:

[root@xjia-client 1212]# ssh 10.4.59.150
root.59.150's password: 
Last login: Wed Dec 12 04:43:12 2012 from vm-188-59-4-10.ose.phx2.redhat.com
[root@broker ~]# ps aux | grep named
root      2289  0.0  0.0 103244   812 pts/0    S+   04:45   0:00 grep named
[root@broker ~]# oo-register-dns -n 10.4.59.176 -h node123 -d example.com -k /var/named/example.com.key  -s 10.4.59.174
[root@broker ~]# dig @10.4.59.174 node123.example.com

; <<>> DiG 9.8.2rc1-RedHat-9.8.2-0.10.rc1.el6_3.6 <<>> @10.4.59.174 node123.example.com
; (1 server found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 9667
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 1, ADDITIONAL: 1

;; QUESTION SECTION:
;node123.example.com.		IN	A

;; ANSWER SECTION:
node123.example.com.	180	IN	A	10.4.59.176

;; AUTHORITY SECTION:
example.com.		1	IN	NS	ns1.example.com.

;; ADDITIONAL SECTION:
ns1.example.com.	1	IN	A	127.0.0.1

;; Query time: 1 msec
;; SERVER: 10.4.59.174#53(10.4.59.174)
;; WHEN: Wed Dec 12 04:46:40 2012
;; MSG SIZE  rcvd: 87

[root@broker ~]# nslookup node123.example.com
Server:		10.4.59.174
Address:	10.4.59.174#53

Name:	node123.example.com
Address: 10.4.59.176

[root@broker ~]# 


Version:
OpenShiftEnterprise/1.1.x/2012-12-11.3/

Comment 8 errata-xmlrpc 2013-01-31 20:32:47 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.

http://rhn.redhat.com/errata/RHSA-2013-0220.html