todaygood / openshift-lab

lab on openshift
0 stars 0 forks source link

用kvm虚拟机做openshift实验,如何配置wildcard DNS? #12

Open todaygood opened 6 years ago

todaygood commented 6 years ago

dig test1.apps.test.cloud.genomics.cn

bind-interfaces

现在这个问题,需要在192.168.122.1:53上 添加wildcard DNS record

address=/.apps.test.cloud.genomics.cn/192.168.122.245

但是libvirt自带的dnsmasq不具有这个功能。

找到了解决方案

https://bugzilla.redhat.com/show_bug.cgi?id=1178933#c5

[root@cloud-sz-kolla-b13-01 bwa]# virsh net-dumpxml  default 
<network connections='1'>
  <name>default</name>
  <uuid>a4f99d86-1c21-4741-9820-2d0c63a2deb8</uuid>
  <forward mode='nat'>
    <nat>
      <port start='1024' end='65535'/>
    </nat>
  </forward>
  <bridge name='virbr0' stp='on' delay='0'/>
  <mac address='52:54:00:ed:8c:a6'/>
  <domain name='cloud.genomics.cn'/>
  <dns>
    <forwarder addr='192.168.60.236'/>
  </dns>
  <ip address='192.168.122.1' netmask='255.255.255.0'>
    <dhcp>
      <range start='192.168.122.2' end='192.168.122.254'/>
    </dhcp>
  </ip>
</network>

Refer

https://docs.openshift.com/container-platform/3.7/install_config/install/prerequisites.html#prereq-dns

可以帮助
https://bugzilla.redhat.com/show_bug.cgi?id=1532856

todaygood commented 6 years ago

use virsh net-update

https://www.redhat.com/archives/libvirt-users/2015-February/msg00089.html

 virsh net-update default add dns-host \
       '<host ip="192.168.122.145">
          <hostname>blah.laine.org</hostname>
          <hostname>blorg.laine.org</hostname>
        </host>' \
       --live --config
todaygood commented 6 years ago

wildcard dns

https://serverfault.com/questions/591920/best-way-to-add-a-dns-wildcard-record-for-a-domain

https://github.com/openshift/origin/issues/16992

http://zhubingbing.cn/2017/07/17/openshift/openshift-env-reday/

https://serverfault.com/questions/727998/dnsmasq-on-virbr0-libvirt-and-network-manager

https://liquidat.wordpress.com/2017/03/03/howto-automated-dns-resolution-for-kvmlibvirt-guests-with-a-local-domain/