Configure an existing PowerDNS server for Designate

Configure an existing PowerDNS server for Designate

If you already have a running PowerDNS server, you can configure and use it for the Designate deployment.

The example configuration below has three predeployed PowerDNS servers.

To configure an existing PowerDNS server for Designate:

  1. Open your PowerDNS server UI.

  2. In etc/powerdns/pdns.conf, modify the following parameters:

    • allow-axfr-ips - must list the IPs of the Designate nodes, which will be located on the OpenStack API nodes

    • api-key - must coincide with the designate_pdns_api_key parameter for Designate in the Reclass model

    • webserver - must have the value yes

    • webserver-port - must coincide with the powerdns_webserver_port parameter for Designate in the Reclass model

    • api - must have the value yes to enable management through API

    • disable-axfr - must have the value no to enable the axfr zone updates from the Designate nodes

    Example:

    allow-axfr-ips=172.16.10.101,172.16.10.102,172.16.10.103,127.0.0.1
    allow-recursion=127.0.0.1
    api-key=VxK9cMlFL5Ae
    api=yes
    config-dir=/etc/powerdns
    daemon=yes
    default-soa-name=a.very.best.power.dns.server
    disable-axfr=no
    guardian=yes
    include-dir=/etc/powerdns/pdns.d
    launch=
    local-address=10.0.0.1
    local-port=53
    master=no
    setgid=pdns
    setuid=pdns
    slave=yes
    soa-minimum-ttl=3600
    socket-dir=/var/run
    version-string=powerdns
    webserver=yes
    webserver-address=10.0.0.1
    webserver-password=gJ6n3gVaYP8eS
    webserver-port=8081
    
  3. Open the classes/cluster/cluster_name/openstack directory in your Git project repository.

  4. In init.yml, add the following parameters:

    powerdns_node01_address: 10.0.0.1
    powerdns_node02_address: 10.0.0.2
    powerdns_node03_address: 10.0.0.3
    powerdns_webserver_password: gJ6n3gVaYP8eS
    powerdns_webserver_port: 8081
    mysql_designate_password: password
    keystone_designate_password: password
    designate_service_host: ${_param:openstack_control_address}
    designate_domain_id: 5186883b-91fb-4891-bd49-e6769234a8fc
    designate_pdns_api_key: VxK9cMlFL5Ae
    designate_pdns_api_endpoint: >
      "http://${_param:powerdns_node01_address}:${_param:powerdns_webserver_port}"
    designate_pool_ns_records:
      - hostname: 'ns1.example.org.'
        priority: 10
    designate_pool_nameservers:
      - host: ${_param:powerdns_node01_address}
        port: 53
      - host: ${_param:powerdns_node02_address}
        port: 53
      - host: ${_param:powerdns_node03_address}
        port: 53
    designate_pool_target_type: pdns4
    designate_pool_target_masters:
      - host: ${_param:openstack_control_node01_address}
        port: 5354
      - host: ${_param:openstack_control_node02_address}
        port: 5354
      - host: ${_param:openstack_control_node03_address}
        port: 5354
    designate_pool_target_options:
      host: ${_param:powerdns_node01_address}
      port: 53
      api_token: ${_param:designate_pdns_api_key}
      api_endpoint: ${_param:designate_pdns_api_endpoint}
    designate_version: ${_param:openstack_version}
    
  5. In control.yml, modify the parameters section. Add targets according to the number of PowerDNS severs that will be managed, three in our case.

    Example:

    designate:
        server:
          backend:
            pdns4:
              api_token: ${_param:designate_pdns_api_key}
              api_endpoint: ${_param:designate_pdns_api_endpoint}
          pools:
            default:
              description: 'test pool'
              targets:
                default:
                  description: 'test target1'
                default1:
                  type: ${_param:designate_pool_target_type}
                  description: 'test target2'
                  masters: ${_param:designate_pool_target_masters}
                  options:
                    host: ${_param:powerdns_node02_address}
                    port: 53
                    api_endpoint: >
                      "http://${_param:${_param:powerdns_node02_address}}:
                      ${_param:powerdns_webserver_port}"
                    api_token: ${_param:designate_pdns_api_key}
                default2:
                  type: ${_param:designate_pool_target_type}
                  description: 'test target3'
                  masters: ${_param:designate_pool_target_masters}
                  options:
                    host: ${_param:powerdns_node03_address}
                    port: 53
                    api_endpoint: >
                      "http://${_param:powerdns_node03_address}:
                      ${_param:powerdns_webserver_port}"
                    api_token: ${_param:designate_pdns_api_key}
    

Once done, proceed to deploy Designate as described in Deploy Designate.