Prepare a deployment model for a new PowerDNS server with the pool_manager role

Prepare a deployment model for a new PowerDNS server with the pool_manager roleΒΆ

If you need live synchronization of DNS zones between Designate and PowerDNS servers, you can configure Designate with the pool_manager role as described below. The Designate Pool Manager keeps records consistent across the Designate database and the PowerDNS servers. For example, if a record was removed from the PowerDNS server due to a hard disk failure, this record will be automatically restored from the Designate database.

To configure a PowerDNS server with the default Designate worker role, see Prepare a deployment model for a new PowerDNS server with the worker role.

The examples provided in this section describe the configuration of the deployment model with two PowerDNS servers deployed on separate VMs of the infrastructure nodes.

To prepare a model for a new PowerDNS server with the pool_manager role:

  1. Open the classes/cluster/cluster_name/openstack directory of your Git project repository.

  2. Create a dns.yml file with the following parameters:

    classes:
    - system.powerdns.server.single
    - cluster.cluster_name.infra
    parameters:
      linux:
        network:
          interface:
            ens3: ${_param:linux_single_interface}
        host:
          dns01:
            address: ${_param:openstack_dns_node01_address}
            names:
            - dns01
            - dns01.${_param:cluster_domain}
          dns02:
            address: ${_param:openstack_dns_node02_address}
            names:
            - dns02
            - dns02.${_param:cluster_domain}
      powerdns:
        server:
          enabled: true
          bind:
            address: ${_param:single_address}
            port: 53
          backend:
            engine: sqlite
            dbname: pdns.sqlite3
            dbpath: /var/lib/powerdns
          api:
            enabled: true
            key: ${_param:designate_pdns_api_key}
          overwrite_supermasters: ${_param:powerdns_supermasters}
          supermasters:
              ${_param:powerdns_supermasters}
          webserver:
            enabled: true
            address: ${_param:single_address}
            port: ${_param:powerdns_webserver_port}
            password: ${_param:powerdns_webserver_password}
          axfr_ips:
            - ${_param:openstack_control_node01_address}
            - ${_param:openstack_control_node02_address}
            - ${_param:openstack_control_node03_address}
            - 127.0.0.1
    

    Note

    If you want to use the MySQL back end instead of the default SQLite one, modify the backend section parameters accordingly and configure your metadata model as described in Enable the MySQL back end for PowerDNS.

  3. In init.yml, define the following parameters:

    Example:

    openstack_dns_node01_address: 10.0.0.1
    openstack_dns_node02_address: 10.0.0.2
    powerdns_axfr_ips:
      - ${_param:openstack_control_node01_address}
      - ${_param:openstack_control_node02_address}
      - ${_param:openstack_control_node03_address}
      - 127.0.0.1
    powerdns_supermasters:
      - ip: ${_param:openstack_control_node01_address}
        nameserver: ns1.example.org
        account: master
      - ip: ${_param:openstack_control_node02_address}
        nameserver: ns2.example.org
        account: master
      - ip: ${_param:openstack_control_node03_address}
        nameserver: ns3.example.org
        account: master
    powerdns_overwrite_supermasters: True
    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_mdns_address: 0.0.0.0
    designate_mdns_port: 53
    designate_pdns_api_key: VxK9cMlFL5Ae
    designate_pdns_api_endpoint: >
      "http://${_param:openstack_dns_node01_address}:${_param:powerdns_webserver_port}"
    designate_pool_manager_enabled: True
    designate_pool_manager_periodic_sync_interval: '120'
    designate_pool_ns_records:
      - hostname: 'ns1.example.org.'
        priority: 10
      - hostname: 'ns2.example.org.'
        priority: 20
      - hostname: 'ns3.example.org.'
        priority: 30
    designate_pool_nameservers:
      - host: ${_param:openstack_dns_node01_address}
        port: 53
      - host: ${_param:openstack_dns_node02_address}
        port: 53
    designate_pool_target_type: pdns4
    designate_pool_target_masters:
      - host: ${_param:openstack_control_node01_address}
        port: ${_param:designate_mdns_port}
      - host: ${_param:openstack_control_node02_address}
        port: ${_param:designate_mdns_port}
      - host: ${_param:openstack_control_node03_address}
        port: ${_param:designate_mdns_port}
    designate_pool_target_options:
      host: ${_param:openstack_dns_node01_address}
      port: 53
      api_token: ${_param:designate_pdns_api_key}
      api_endpoint: ${_param:designate_pdns_api_endpoint}
    designate_version: ${_param:openstack_version}
    
  4. In control.yml, define the following parameters in the parameters section:

    Example:

    designate:
      pool_manager:
        enabled: ${_param:designate_pool_manager_enabled}
        periodic_sync_interval: ${_param:designate_pool_manager_periodic_sync_interval}
      server:
        backend:
          pdns4:
            api_token: ${_param:designate_pdns_api_key}
            api_endpoint: ${_param:designate_pdns_api_endpoint}
        mdns:
          address: ${_param:designate_mdns_address}
          port: ${_param:designate_mdns_port}
        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:openstack_dns_node02_address}
                  port: 53
                  api_endpoint: >
                    "http://${_param:openstack_dns_node02_address}:
                    ${_param:powerdns_webserver_port}"
                  api_token: ${_param:designate_pdns_api_key}
    
  5. In classes/cluster/cluster_name/infra/kvm.yml, modify the classes and parameters sections.

    Example:

    • In the classes section:

      classes:
      - system.salt.control.cluster.openstack_dns_cluster
      
    • In the parameters section, add the DNS parameters for VMs with the required location of DNS VMs on the kvm nodes and the planned resource usage for them.

      salt:
        control:
            openstack.dns:
              cpu: 2
              ram: 2048
              disk_profile: small
              net_profile: default
          cluster:
            internal:
              node:
                dns01:
                  provider: kvm01.${_param:cluster_domain}
                dns02:
                  provider: kvm02.${_param:cluster_domain}
      
  6. In classes/cluster/cluster_name/infra/config.yml, modify the classes and parameters sections.

    Example:

    • In the classes section:

      classes:
      - system.reclass.storage.system.openstack_dns_cluster
      
    • In the parameters section, add the DNS VMs. For example:

      reclass:
        storage:
          node:
            openstack_dns_node01:
              params:
                linux_system_codename: xenial
            openstack_dns_node02:
              params:
                linux_system_codename: xenial
      
  7. Commit and push the changes.

Once done, proceed to deploy the PowerDNS server service as described in Deploy a new PowerDNS server for Designate.