3. Install Service Discovery
Service Discovery makes every component of the a9s Data Services Framework and every Service Instance resolvable by
name, within the framework and from the Application Platform. It consists of a Discovery Agent
on every VM, and a deployment of its own (consul-dns) with the Service Discovery Servers and the Dnsmasq VMs. It must
be in place before any of the a9s Data Services and the a9s Data Services Framework components are deployed.
For further details, see Service Discovery documentation.
3.1. Create an Encryption Key
The Discovery Agents and Service Discovery Servers encrypt their traffic among each other with a key. BOSH cannot create
this key, so it must be created manually and stored in the BOSH Director's CredHub under the name /cdns_encrypt.
A valid encryption key can be created with the consul CLI by executing:
consul keygen
It can then be stored in CredHub by executing the following command:
credhub set -n=/cdns_encrypt \
-w='<valid_encryption_key>' \
-t password
3.2. Deploy Service Discovery
The deployment, with the Service Discovery Servers and the Dnsmasq VMs, is created by executing:
bosh -d consul-dns deploy consul-dns/consul-dns.yml \
-l config/iaas-config.yml
3.3. Make Service Discovery Available in the Application Platform
The applications deployed to the Application Platform (e.g. Cloud Foundry) must be able to resolve the names of the
Service Discovery Catalog. The suffix/TLD of these names, the discovery domain, is set in the IaaS configuration under
iaas.consul.domain.
To configure DNS query delegation in the existing nameserver, the nameservers must be set up to delegate all DNS queries
that end with the selected suffix to the IP addresses of the Dnsmasq VMs (iaas.consul.dnsmasq_ips).
If setting up DNS query delegation in the nameserver is not an option, the IP addresses of the Dnsmasq VMs can be
configured in the platform, so that each DNS query is first redirected to the consul-dns deployment. The Dnsmasq VMs
redirect all queries that do not end with the selected suffix to upstream nameservers
(iaas.consul.dnsmasq.upstream_nameservers).
Once Service Discovery is available in the platform, it must be verified that names in the discovery domain as well as external hostnames can be resolved. This check must be performed in each availability zone.