### Integrate DNS Aliases via Operations File Source: https://context7.com/cloudfoundry/bosh-dns-aliases-release/llms.txt Uses a BOSH operations file to inject the bosh-dns-aliases release and configure service discovery for core Cloud Foundry components. ```yaml # cf-deployment-ops.yml - Operations file for CF deployment - type: replace path: /releases/- value: name: bosh-dns-aliases version: "0.0.4" url: https://bosh.io/d/github.com/cloudfoundry/bosh-dns-aliases-release sha1: # get from bosh.io - type: replace path: /instance_groups/name=diego-cell/jobs/- value: name: bosh-dns-aliases release: bosh-dns-aliases properties: aliases: # CredHub service discovery - domain: credhub.service.cf.internal targets: - query: "*" instance_group: credhub deployment: ((deployment_name)) network: default domain: bosh # UAA service discovery - domain: uaa.service.cf.internal targets: - query: "*" instance_group: uaa deployment: ((deployment_name)) network: default domain: bosh # Routing API - domain: routing-api.service.cf.internal targets: - query: "*" instance_group: api deployment: ((deployment_name)) network: default domain: bosh ``` -------------------------------- ### Basic DNS Alias Configuration Source: https://context7.com/cloudfoundry/bosh-dns-aliases-release/llms.txt Configure DNS aliases to map custom domain names to BOSH instance groups. Ensure the 'bosh-dns-aliases' release is included in your deployment. ```yaml # deployment.yml - Basic DNS alias configuration name: my-deployment releases: - name: bosh-dns-aliases version: latest instance_groups: - name: dns-config instances: 1 azs: [z1] vm_type: minimal stemcell: default networks: - name: default jobs: - name: bosh-dns-aliases release: bosh-dns-aliases properties: aliases: # Map credhub.cf.internal to multiple instance groups - domain: credhub.cf.internal targets: - query: "*" instance_group: credhub deployment: cf network: default domain: bosh # Map nats.cf.internal to NATS servers - domain: nats.cf.internal targets: - query: "*" instance_group: nats deployment: cf network: default domain: bosh # Map database.service.internal to Diego cells - domain: database.service.internal targets: - query: "*" instance_group: diego_cell1 deployment: cf_123 network: default_123 domain: bosh - query: "*" instance_group: diego_cell2 deployment: cf_123 network: default_123 domain: bosh ``` -------------------------------- ### Alias Target Properties Explained Source: https://context7.com/cloudfoundry/bosh-dns-aliases-release/llms.txt Defines how custom domain names are mapped to BOSH instance groups. The system canonicalizes input values by converting underscores to hyphens, lowercasing, and removing special characters, except for wildcards. ```yaml # Alias target properties explained properties: aliases: - domain: myservice.internal # The custom domain to create targets: - query: "*" # Query pattern: "*" for all instances, "q-s0" for healthy only instance_group: web_server # Converted to "web-server" in DNS query deployment: my_app_v2 # Converted to "my-app-v2" in DNS query network: private_net # Converted to "private-net" in DNS query domain: bosh # BOSH DNS domain (optional, defaults to spec.dns_domain_name) # Generated aliases.json output: # { # "myservice.internal": [ # "*.web-server.private-net.my-app-v2.bosh" # ] # } ``` -------------------------------- ### Run RSpec Tests for Alias Logic Source: https://context7.com/cloudfoundry/bosh-dns-aliases-release/llms.txt Commands to clone the repository and execute the test suite to validate alias template generation and canonicalization rules. ```bash # Clone the repository git clone https://github.com/cloudfoundry/bosh-dns-aliases-release.git cd bosh-dns-aliases-release # Install dependencies and run tests cd spec bundle install gem install rspec rspec bosh-dns-aliases_spec.rb ``` -------------------------------- ### Configure DNS Aliases in deployment.yml Source: https://context7.com/cloudfoundry/bosh-dns-aliases-release/llms.txt Defines DNS aliases for high-availability services, mapping domains to specific instance groups across deployments using health-aware query patterns. ```yaml properties: aliases: # Single domain resolving to multiple instance groups across deployments - domain: api.cf.internal targets: # Primary API servers in production deployment - query: "q-s0" # Only healthy instances instance_group: api deployment: cf-production network: default domain: bosh # Secondary API servers in DR deployment - query: "q-s0" instance_group: api deployment: cf-disaster-recovery network: default domain: bosh # Database cluster with read replicas - domain: postgres.cf.internal targets: - query: "q-m0" # Master instance only instance_group: postgres_master deployment: data_services network: db_network domain: bosh - query: "q-s0" # All healthy replicas instance_group: postgres_replica deployment: data_services network: db_network domain: bosh ``` -------------------------------- ### DNS Handlers Configuration Source: https://context7.com/cloudfoundry/bosh-dns-aliases-release/llms.txt Configure custom DNS handlers to forward queries for specific domains to external resolvers, enabling integration with external DNS services or HTTP endpoints. Caching can be enabled or disabled per handler. ```yaml # deployment.yml - DNS handlers configuration instance_groups: - name: dns-config jobs: - name: bosh-dns-handlers release: bosh-dns-aliases properties: handlers: # Forward .consul queries to Consul DNS - domain: consul. cache: enabled: true source: type: dns recursors: - 127.0.0.1:8600 # Forward .internal queries to HTTP endpoint - domain: local.internal. cache: enabled: true source: type: http url: http://service-discovery.local:8080/dns-query # Forward external domains to corporate DNS - domain: corp.example.com. cache: enabled: false source: type: dns recursors: - 10.0.0.53:53 - 10.0.0.54:53 ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.