Hi Scott, Thanks for your response.
My cluster infrastructure is as below, 10.1.241.54 lb 10.1.236.92/93 master 10.1.241.55/56 work nodes All the machines are VMs provisioned by OpenStack. I tried to run "dig redis-svc.redis.svc.cluster.local" on all the nodes. The instruction failed on node 10.1.236.92. But service dnsmasq is running on the host node. Why did the instruction only fail on this node? Another question is about dns name of the container. In my test case, there is one pod which has two containers named "master" and "sentinel". [root@host-10-1-236-93 ~]# oc get pods -n redis -o wide NAME READY STATUS RESTARTS AGE IP NODE sb-2017-redis-master-qp13j 2/2 Running 0 14m 10.130.0.3 host-10-1-241-55 And following operations failed with error reason "connection timed out; no servers could be reached". dig sb-2017-redis-master-qp13j.redis.cluster.local dig master.sb-2017-redis-master-qp13j.redis.cluster.local dig master.sb-2017-redis-master-qp13j.cluster.local dig master.redis.cluster.local Could containers be find by dns name with the format <container name>.<pod_namespace>.cluster.local? I followed the document via https://docs.openshift.org/1.5/architecture/additional_concepts/networking.html. Is there any misunderstanding about this? However, it seems that dns name of svc and endpoints works for me. Thanks, Jared, (韦煜) Software developer Interested in open source software, big data, Linux ________________________________ From: Scott Dodson <sdod...@redhat.com> Sent: Monday, August 21, 2017 9:10:44 PM To: Yu Wei Cc: users@lists.openshift.redhat.com; d...@lists.openshift.redhat.com Subject: Re: Question about Openshift origin DNS 10.1.241.55 should be the IP address of the node and dnsmasq should be running on the node which will route queries for 'cluster.local' to the appropriate place. Can you check on dnsmasq on the node? On Mon, Aug 21, 2017 at 6:38 AM, Yu Wei <yu20...@hotmail.com<mailto:yu20...@hotmail.com>> wrote: Hi, I setup Openshift Origin 1.5 with openvswitch network plugin. It seemed that dns server setup was not properly within pod. services, endpoints couldn't be reached by name. Within pod, /etc/resolv.conf contains following content, root@sb-2017-redis-master-w7g44:/data# cat /etc/resolv.conf search redis.svc.cluster.local svc.cluster.local cluster.local nameserver 10.1.241.55 options ndots:5 Then I added "172.30.0.1" to /etc/resolv.conf as below, root@sb-2017-redis-master-w7g44:/data# cat /etc/resolv.conf search redis.svc.cluster.local svc.cluster.local cluster.local nameserver 10.1.241.55 options ndots:5 nameserver 172.30.0.1 Then services, endpoints could be found by dns name. So why is "nameserver 172.30.0.1" not added to /etc/resolv.conf automatically? Did I missed anything when setup cluster? [root@host-10-1-236-92 gluster]# dig redis-svc.redis.svc.cluster.local ; <<>> DiG 9.9.4-RedHat-9.9.4-29.el7 <<>> redis-svc.redis.svc.cluster.local ;; global options: +cmd ;; Got answer: ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 4207 ;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0 ;; QUESTION SECTION: ;redis-svc.redis.svc.cluster.local. IN A ;; ANSWER SECTION: redis-svc.redis.svc.cluster.local. 30 IN A 172.30.4.92 ;; Query time: 2 msec ;; SERVER: 172.30.0.1#53(172.30.0.1) ;; WHEN: Mon Aug 21 18:48:50 CST 2017 ;; MSG SIZE rcvd: 67 [root@host-10-1-236-92 gluster]# dig redis-svc.redis.endpoints.cluster.local ; <<>> DiG 9.9.4-RedHat-9.9.4-29.el7 <<>> redis-svc.redis.endpoints.cluster.local ;; global options: +cmd ;; Got answer: ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 19434 ;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0 ;; QUESTION SECTION: ;redis-svc.redis.endpoints.cluster.local. IN A ;; ANSWER SECTION: redis-svc.redis.endpoints.cluster.local. 30 IN A 10.130.0.2 ;; Query time: 5 msec ;; SERVER: 172.30.0.1#53(172.30.0.1) ;; WHEN: Mon Aug 21 18:49:05 CST 2017 ;; MSG SIZE rcvd: 73 Thanks, Jared, (韦煜) Software developer Interested in open source software, big data, Linux _______________________________________________ users mailing list users@lists.openshift.redhat.com<mailto:users@lists.openshift.redhat.com> http://lists.openshift.redhat.com/openshiftmm/listinfo/users
_______________________________________________ users mailing list users@lists.openshift.redhat.com http://lists.openshift.redhat.com/openshiftmm/listinfo/users