CentOS Stream 9
Sponsored Link

OpenStack Antelope : Designate 設定 (Network ノード)2023/04/19

 
OpenStack DNS Service(Designate)をインストールします。
当例では以下のような環境を例に Designate をインストールします。
Network ノードに Designate サービス一式をインストールし、バックエンドの DNS サービスとして BIND 9 を設定します。
BIND 9 以外にも PowerDNS などもバックエンド DNS として利用可能です。
------------+--------------------------+--------------------------+------------
            |                          |                          |
        eth0|10.0.0.30             eth0|10.0.0.50             eth0|10.0.0.51
+-----------+-----------+  +-----------+-----------+  +-----------+-----------+
|   [ dlp.srv.world ]   |  | [ network.srv.world ] |  |  [ node01.srv.world ] |
|     (Control Node)    |  |     (Network Node)    |  |     (Compute Node)    |
|                       |  |                       |  |                       |
|  MariaDB    RabbitMQ  |  |      Open vSwitch     |  |        Libvirt        |
|  Memcached  Nginx     |  |     Neutron Server    |  |      Nova Compute     |
|  Keystone   httpd     |  |      OVN-Northd       |  |      Open vSwitch     |
|  Glance     Nova API  |  |  Nginx  iSCSI Target  |  |   OVN Metadata Agent  |
|  Cinder API           |  |     Cinder Volume     |  |     OVN-Controller    |
|                       |  |   Designate Services  |  |                       |
+-----------------------+  +-----------------------+  +-----------------------+

[1] Designate サービス および BIND 9 をインストールします。
# Antelope, EPEL, CRB からインストール

[root@network ~]#
dnf --enablerepo=centos-openstack-antelope,epel,crb -y install openstack-designate-api openstack-designate-central openstack-designate-worker openstack-designate-producer openstack-designate-mdns python3-designateclient bind bind-utils
[2] Designate から BIND が利用できるよう設定しておきます。
[root@network ~]#
rndc-confgen -a -k designate -c /etc/designate.key

wrote key file "/etc/designate.key"
[root@network ~]#
chown named:designate /etc/designate.key

[root@network ~]#
chmod 640 /etc/designate.key

[root@network ~]#
mv /etc/named.conf /etc/named.conf.org

[root@network ~]#
vi /etc/named.conf
# 新規作成

options {
        listen-on port 53 { any; };
        listen-on-v6 port 53 { none; };
        directory       "/var/named";
        dump-file       "/var/named/data/cache_dump.db";
        statistics-file "/var/named/data/named_stats.txt";
        memstatistics-file "/var/named/data/named_mem_stats.txt";
        # クエリの許可範囲は自身の環境に合わせて置き換え
        allow-query     { localhost; 10.0.0.0/24; };
        allow-new-zones yes;
        request-ixfr no;
        recursion no;
        bindkeys-file "/etc/named.iscdlv.key";
        managed-keys-directory "/var/named/dynamic";
        pid-file "/run/named/named.pid";
        session-keyfile "/run/named/session.key";
};
include "/etc/designate.key";
controls {
    inet 0.0.0.0 port 953
    allow { localhost; } keys { "designate"; };
};
logging {
        channel default_debug {
                file "data/named.run";
                severity dynamic;
        };
};
zone "." IN {
        type hint;
        file "named.ca";
};

[root@network ~]#
chmod 640 /etc/named.conf

[root@network ~]#
chgrp named /etc/named.conf

[root@network ~]#
chown -R named. /var/named

[root@network ~]#
systemctl enable --now named

[3] Designate の設定です。
[root@network ~]#
mv /etc/designate/designate.conf /etc/designate/designate.conf.org

[root@network ~]#
vi /etc/designate/designate.conf
# 新規作成

[DEFAULT]
log_dir = /var/log/designate
# RabbitMQ 接続情報
transport_url = rabbit://openstack:password@dlp.srv.world
root_helper = sudo designate-rootwrap /etc/designate/rootwrap.conf

[database]
# MariaDB 接続情報
connection = mysql+pymysql://designate:password@dlp.srv.world/designate

[service:api]
listen = 127.0.0.1:9001
auth_strategy = keystone
api_base_uri = https://network.srv.world:9001
enable_api_v2 = True
enabled_extensions_v2 = quotas, reports

# Keystone 認証情報
[keystone_authtoken]
www_authenticate_uri = https://dlp.srv.world:5000
auth_url = https://dlp.srv.world:5000
memcached_servers = dlp.srv.world:11211
auth_type = password
project_domain_name = default
user_domain_name = default
project_name = service
username = designate
password = servicepassword
# httpd Keystone で自己署名の証明書を使用の場合は [true]
insecure = false

[service:worker]
enabled = True
notify = True

[storage:sqlalchemy]
# MariaDB 接続情報
connection = mysql+pymysql://designate:password@dlp.srv.world/designate

[oslo_policy]
enforce_new_defaults = false

[root@network ~]#
chmod 640 /etc/designate/designate.conf

[root@network ~]#
chgrp designate /etc/designate/designate.conf

[root@network ~]#
su -s /bin/bash -c "designate-manage database sync" designate

[root@network ~]#
systemctl enable --now designate-central designate-api
[root@network ~]#
vi /etc/designate/pools.yaml
# 新規作成 (ホスト名や IP アドレスは自身の環境に合わせて置き換え)

- name: default
  description: Default Pool
  attributes: {}
  ns_records:
    - hostname: network.srv.world.
      priority: 1
  nameservers:
    - host: 10.0.0.50
      port: 53
  targets:
    - type: bind9
      description: BIND9 Server
      masters:
        - host: 10.0.0.50
          port: 5354
      options:
        host: 10.0.0.50
        port: 53
        rndc_host: 10.0.0.50
        rndc_port: 953
        rndc_key_file: /etc/designate.key

[root@network ~]#
chmod 640 /etc/designate/pools.yaml

[root@network ~]#
chgrp designate /etc/designate/pools.yaml

[root@network ~]#
su -s /bin/bash -c "designate-manage pool update" designate

Updating Pools Configuration
****************************
[root@network ~]#
systemctl enable --now designate-worker designate-producer designate-mdns
[4] Nginx にプロキシの設定をします。
[root@network ~]#
vi /etc/nginx/nginx.conf
# [stream] セクション内に追記

stream {
    upstream neutron-api {
        server 127.0.0.1:9696;
    }
    server {
        listen 10.0.0.50:9696 ssl;
        proxy_pass neutron-api;
    }
    upstream designate-api {
        server 127.0.0.1:9001;
    }
    server {
        listen 10.0.0.50:9001 ssl;
        proxy_pass designate-api;
    }
    ssl_certificate "/etc/letsencrypt/live/network.srv.world/fullchain.pem";
    ssl_certificate_key "/etc/letsencrypt/live/network.srv.world/privkey.pem";
}

[root@network ~]#
systemctl restart nginx
[5] SELinux を有効にしている場合は、ポリシーの変更が必要です。
[root@network ~]#
setsebool -P named_write_master_zones on

[6] Firewalld を有効にしている場合は、サービスポートの許可が必要です。
[root@network ~]#
firewall-cmd --add-service=dns

[root@network ~]#
firewall-cmd --add-port={5354/tcp,5354/udp,9001/tcp}

success
[root@network ~]#
firewall-cmd --runtime-to-permanent

success
[7] Openstack に認証可能な任意のノードでステータスを確認します。全て [up] 状態であれば OK です。
[root@dlp ~(keystone)]#
dnf --enablerepo=centos-openstack-antelope,epel,crb -y install python3-designateclient
[root@dlp ~(keystone)]#
openstack dns service list

+--------------------------------------+-------------------+--------------+--------+-------+--------------+
| id                                   | hostname          | service_name | status | stats | capabilities |
+--------------------------------------+-------------------+--------------+--------+-------+--------------+
| 5f7c826e-5573-4bb0-bf4c-b9bddc694d4e | network.srv.world | central      | UP     | -     | -            |
| ad3c5ec6-40c7-4902-8fe0-dfeea389bf70 | network.srv.world | api          | UP     | -     | -            |
| 1910baa6-7a93-492b-a80e-1e922dd2263c | network.srv.world | producer     | UP     | -     | -            |
| e63d002b-817a-4f0c-a016-24690f686a7f | network.srv.world | worker       | UP     | -     | -            |
| f915629d-0ae0-4b7c-a88c-fd03fe962024 | network.srv.world | mdns         | UP     | -     | -            |
+--------------------------------------+-------------------+--------------+--------+-------+--------------+
関連コンテンツ