If you have load balancers in multiple regions, use a global DNS proximity-based service address. If you cannot create a global DNS proximity-based service address, as a workaround, you can use Hiera to configure agent server address settings for each region, based on fact information about agent location.
Version and installation information
PE version: 2019.8 and later
Solution
For each region, configure load balancer parameters in your hierarchy.
Note: When using this solution, you might not be able to use the regional load balancer address to download and install the agent install script. You can either use another method to install the agent, or use a single globally resolvable load balancer hostname to install the agent.
If you use a single globally resolvable hostname, use it as the value for the compile_master_pool_address
parameter. The compile_master_pool_address
parameter can either be a regional compiler hostname (if you have one compiler in that region) or a globally resolvable load balancer that sends the requests to multiple compilers.
For a globally resolvable hostname, you can:
- Point directly to a central group of compilers or
- Use a short name that is expanded by an agent’s resolver search configuration that resolves to a regional load balancer hostname or
- Use any method that ensures that the agent always resolves the hostname to the regional load balancer’s IP address.
In the following example hierarchy, the load-balancing regions are continents. Regional load balancers and pe_repo::compile_master_pool_address
use placeholders values. Please modify the placeholder values for your installation.
In hiera.yaml
:
hierarchy: - name: "Higher precedence levels" Paths: ... - name: "Per-continent configuration" path: "continents/%{facts.continent}.yaml" # ^^^^^^^^^^^^^^^^^^^^^^^ # Can resolve to europe.yaml, asia.yaml, etc. - name: "Lower precedence levels" Paths: ...
In continents/europe.yaml
:
pe_repo::compile_master_pool_address: "<GLOBALLY-RESOLVABLE-LOAD-BALANCER>" # A globally resolvable load balancer hostname or the regional load balancer hostname puppet_enterprise::profile::agent::pcp_broker_list: ["<EUROPE-LOAD-BALANCER:8142>"] puppet_enterprise::profile::agent::primary_uris: ["<EUROPE-LOAD-BALANCER:8140>"] puppet_enterprise::profile::agent::server_list: ["<EUROPE-LOAD-BALANCER:8140>"] puppet_enterprise::profile::agent::manage_puppet_conf: true
In continents/asia.yaml
:
pe_repo::compile_master_pool_address: "<GLOBALLY-RESOLVABLE-LOAD-BALANCER>" # A globally resolvable load balancer hostname or the regional load balancer hostname puppet_enterprise::profile::agent::pcp_broker_list: ["<ASIA-LOAD-BALANCER:8142>"] puppet_enterprise::profile::agent::primary_uris: ["<ASIA-LOAD-BALANCER>"] puppet_enterprise::profile::agent::server_list: ["<ASIA-LOAD-BALANCER>"] puppet_enterprise::profile::agent::manage_puppet_conf: true
How can we improve this article?
0 comments
Please sign in to leave a comment.
Related articles