-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
106497: roachprod: add DNS support for services r=renatolabs,smg260 a=herkolategan This change lays the foundation for adding DNS providers to `roachprod`. It is required to be able to keep track of multiple services that are running on the same VM. For example running multiple external SQL processes and a shared process on the same VM. A service denotes a unit of functionality provided on a set of given hosts and ports(i.e., a singular service can be served by multiple VMs) An implementation for local clusters is introduced as well as an interface for managing DNS records. The local implementation does not use true DNS services, but emulates it through local storage. This is to avoid the complexities of a per operating system implementation for local-only DNS resolution. The feature is currently disabled for cloud clusters. Once a DNS cloud provider implementation is completed for the interface the feature can be enabled more widely. Each VM is required to have a public DNS name for the services functionality to function. The typical layout of DNS records for services pertaining to a cluster will look as follows: `_<tenant>-<service_type>._<proto>.<cluster>.<dns_zone> -> host:port` For example: ``` _system-sql._tcp.cluster-name.roachprod-managed.crdb.io -> cluster-name-0001.roachprod.crdb.io : sql port (26257) _system-sql._tcp.cluster-name.roachprod-managed.crdb.io -> cluster-name-0002.roachprod.crdb.io : sql port (26257) _system-sql._tcp.cluster-name.roachprod-managed.crdb.io -> cluster-name-0003.roachprod.crdb.io : sql port (26257) ``` When multiple tenants are running on the same VM (0001) the records will take this form: ``` _tenant1-sql._tcp.cluster-name.roachprod-managed.crdb.io -> cluster-name-0001.roachprod.crdb.io : sql port (29001) _tenant2-sql._tcp.cluster-name.roachprod-managed.crdb.io -> cluster-name-0001.roachprod.crdb.io : sql port (29002) ``` Note the DNS SRV records here point to the same host, but different ports. Services will also need to find open ports on VMs when multiple services are running on the VM to avoid a port collision. To facilitate this a new script has been added to scan for open ports given a starting port. Having nondeterministic ports introduces a dependency on the DNS service to be able to determine which services are running on which ports. Providers are currently not required to provide a DNS implementation, nor are VMs required to specify a DNS Provider. The VM functions that invoke DNS operations are lenient in order to allow falling back to default service-less topologies. For now a fallback is provided to supply the default ports if no DNS provider is present. It is now possible to specify ports for SQL and UI services via `StartOpts`. These ports are used when registering DNS records against a DNS provider. This provides the functionality to not only start external service processes on different ports, but the host cluster as well. To facilitate this the port resolution is done prior to starting a cluster, as nodes need the information beforehand to be able to join the cluster. A few things are not covered in this change: 1. The `roachprod` log and stop commands need revisiting to support more than one process on a single VM. 2. Implementations of the DNS interface for a cloud provider. 3. Update all areas where connection information is assumed rather than queried. Epic: [CRDB-18499](https://cockroachlabs.atlassian.net/browse/CRDB-18499) Release note: None Co-authored-by: Herko Lategan <[email protected]>
- Loading branch information
Showing
34 changed files
with
1,373 additions
and
177 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.