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

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

Before you deploy a PowerDNS server as a back end for Designate, prepare your deployment model with the default Designate worker role as described below.

If you need live synchronization of DNS zones between Designate and PowerDNS servers, configure Designate with the pool_manager role as described in Prepare a deployment model for a new PowerDNS server with the pool_manager 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 deployment model for a new PowerDNS server:

  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}
          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_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:openstack_dns_node01_address}:${_param:powerdns_webserver_port}"
    designate_pool_ns_records:
      - hostname: 'ns1.example.org.'
        priority: 10
    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: 5354
      - host: ${_param:openstack_control_node02_address}
        port: 5354
      - host: ${_param:openstack_control_node03_address}
        port: 5354
    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}
    designate_worker_enabled: true
    
  4. In control.yml, define the following parameters in the parameters section:

    Example:

    designate:
      worker:
        enabled: ${_param:designate_worker_enabled}
      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: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 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.