【问题标题】:DNS set-up for an OpenShift clusterOpenShift 集群的 DNS 设置
【发布时间】:2019-10-01 20:39:22
【问题描述】:

我正在尝试使用虚拟机设置 OpenShift 集群,如 here 所述。这些虚拟机将托管在 VirtualBox 上。在这篇文章中,在 DNS 下,它说,

集群中的所有主机都需要通过 DNS 进行解析。此外,如果使用控制节点作为 ansible 安装程序,它也应该能够解析集群中的所有主机。

我已经开始使用 BIND9 here 设置 DNS 服务器。我可以为集群应用 BIND9 安装说明吗?是否应该在其中一个主节点上设置 DNS 服务器?单独的虚拟机?

【问题讨论】:

    标签: dns openshift virtualbox


    【解决方案1】:

    对于 OpenShift 3.X 和 4.X,它应该设置在一个单独的位置(VM、Raspberry Pi 等),并且应该为所有集群主机、公共 api 端点设置 A 和 PTR 记录,私有 api 端点和 HAProxy 入口控制器。

    注意:如果您正在部署 Openshift 4.X,uncontained.io 上的文档会有点过时,因为 Red Hat 咨询会赶上他们的文档。 OpenShift 3.X 和 4.X 的安装和管理机制截然不同。

    如果您要部署 OpenShift 4.1,您还需要 etcd 的 A 记录和 SRV 记录。

    OpenShift 4.1 裸机 DNS 要求的文档可以在 here 找到

    一个示例 dnsmasq 设置,我用于单主单工作程序 OpenShift 4.1 裸机集群,其中 cluster_name: ocp4base_domain:example.com 以及用作 DNS 服务器、DHCP 服务器、负载平衡器和 PXE 服务器的实用程序服务器可能看起来像:

    no-hosts
    domain=example.com,10.0.10.0/24,local
    auth-zone=example.com,10.0.10.0/24
    
    host-record=ocp4-utility.example.com,10.0.10.10
    host-record=ocp4-master.example.com,10.0.10.11
    host-record=ocp4-worker,10.0.10.12
    host-record=ocp4-bootstrap,10.0.10.13
    
    host-record=api.ocp4.example.com,10.0.10.10
    host-record=api-int.ocp4.example.com,10.0.10.10
    
    host-record=etcd-0.ocp4.example.com,10.0.10.11
    srv-host=_etcd-server-ssl._tcp.ocp4.example.com,etcd-0.ocp4.example.com,2380,0,10
    
    address=/apps.ocp4.example.com/10.0.10.10
    

    这是在实用程序服务器上运行的“负载平衡器”的 HAProxy 配置:

    global
        log         127.0.0.1 local2
        chroot      /var/lib/haproxy
        pidfile     /var/run/haproxy.pid
        maxconn     4000
        user        haproxy
        group       haproxy
        daemon
    
    defaults
        mode                    tcp
        log                     global
        option                  tcplog
        retries                 3
        timeout http-request    10s
        timeout queue           1m
        timeout connect         10s
        timeout client          1m
        timeout server          1m
        timeout http-keep-alive 10s
        timeout check           10s
        maxconn                 3000
    
    listen stats
        bind :9000
        mode http
        stats enable
        stats hide-version
        stats realm Haproxy\ Statistics
        stats uri /haproxy_stats
        stats auth admin:admin
    
    frontend kubernetes_api
        bind 0.0.0.0:6443
        default_backend kubernetes_api
    
    backend kubernetes_api
        balance roundrobin
        option ssl-hello-chk
        server bootstrap 10.0.10.13:6443 check
        server master 10.0.10.11:6443 check
    
    frontend machine_config
        bind 0.0.0.0:22623
        default_backend machine_config
    
    backend machine_config
        balance roundrobin
        option ssl-hello-chk
        server bootstrap 10.0.10.13:22623 check
        server master 10.0.10.11:22623 check
    
    frontend router_https
        bind 0.0.0.0:443
        default_backend router_https
    
    backend router_https
        balance roundrobin
        option ssl-hello-chk
        server worker 10.0.10.12:443 check
    
    frontend router_http
        mode http
        option httplog
        bind 0.0.0.0:80
        default_backend router_http
    
    backend router_http
        mode http
        balance roundrobin
        server worker 10.0.10.12:80 check
    

    【讨论】:

    • 我将构建 OpenShift 3.x 集群,因为 Ansible 方法“更简单”。关于为 OpenShift 3.x 设置 A 和 PTR 记录的任何建议?
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-12-07
    • 2016-01-28
    • 2018-12-21
    • 2018-11-27
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多