OpenStack: Designate (DNSaaS)

Configure kolla-ansible

#echo 'designate_tag: "7.0.1.2"' >> /etc/kolla/globals.yml
sed -i 's/[#]dns_interface:/dns_interface:/g' /etc/kolla/globals.yml
sed -i 's/[#]enable_designate: .*/enable_designate: "yes"/g' /etc/kolla/globals.yml
sed -i 's/[#]enable_horizon_designate:/enable_horizon_designate:/g' /etc/kolla/globals.yml
sed -i 's/[#]designate_ns_record: .*/designate_ns_record: "pool.{{ os_environment }}.example.com"/g' /etc/kolla/globals.yml

Configure pool

mkdir -p /etc/kolla/config/foo/designate
 
/etc/kolla/config/foo/designate/pools.yaml
- name: default-bind
  description: Default BIND9 Pool
  attributes: {}
  ns_records:
    - hostname: ns1.dev.i.example.com.
      priority: 1
  nameservers:
    - host: 10.0.4.45
      port: 53
  targets:
    - type: bind9
      description: BIND9 Server 1
      masters:
        - host: 10.0.4.135
          port: 5354
      options:
        host: 10.0.4.45
        port: 53
        rndc_host: 10.0.4.45
        rndc_port: 953
        rndc_key_file: /etc/designate/rndc.key

Deploy Designate container

kolla-ansible -i /etc/kolla/inventory deploy -t designate
 
# Test endpoint
curl designate.service.${ENV}.i.example.com:9001

Configure neutron

grep designate_keystone_password /etc/kolla/passwords.yml 
 
vi /etc/kolla/config/ew/neutron.conf
[DEFAULT]
...
external_dns_driver = designate
dns_domain = pool.stage.example.com.
 
[designate]
url = http://designate.service.stage.i.example.com:9001/v2
auth_type = password
auth_url = http://keystone-admin.service.stage.i.example.com:35357
username = designate
password = xxxxxxxxxxxxxxxxxxx
project_name = service
project_domain_name = default
user_domain_name = default
allow_reverse_dns_lookup = True
ipv4_ptr_zone_prefix_size = 24
ipv6_ptr_zone_prefix_size = 116
ptr_zone_email = foo@example.com
 
kolla-ansible -i /etc/kolla/inventory reconfigure -t neutron

Install designate client

pip install python-designateclient
openstack dns service list
openstack zone list
openstack zone create --email foo@example.com pool.stage.example.com.

List all recordsets

ZONES=$(openstack zone list -c name -f value)
for ZONE in ${ZONES}; do
    openstack recordset list ${ZONE}
done