From 559cc35fb94d36cbc51ec89cacc22f0a3e51eaf1 Mon Sep 17 00:00:00 2001 From: Michael Nairn Date: Fri, 9 Feb 2024 14:30:19 +0000 Subject: [PATCH] docs: add managedzone and provider docs --- docs/managedzone.md | 82 +++++++++++++++++++++++++++++++++++ docs/provider.md | 69 +++++++++++++++++++++++++++++ docs/reference/managedzone.md | 46 ++++++++++++++++++++ 3 files changed, 197 insertions(+) create mode 100644 docs/managedzone.md create mode 100644 docs/provider.md create mode 100644 docs/reference/managedzone.md diff --git a/docs/managedzone.md b/docs/managedzone.md new file mode 100644 index 00000000..13837a8e --- /dev/null +++ b/docs/managedzone.md @@ -0,0 +1,82 @@ +# Creating and using a ManagedZone resource. + +## What is a ManagedZone +A ManagedZone is a reference to a [DNS zone](https://en.wikipedia.org/wiki/DNS_zone). +By creating a ManagedZone we are instructing the MGC about a domain or subdomain that can be used as a host by any gateways in the same namespace. +These gateways can use a subdomain of the ManagedZone. + +If a gateway attempts to a use a domain as a host, and there is no matching ManagedZone for that host, then that host on that gateway will fail to function. + +A gateway's host will be matched to any ManagedZone that the host is a subdomain of, i.e. `test.api.hcpapps.net` will be matched by any ManagedZone (in the same namespace) of: `test.api.hcpapps.net`, `api.hcpapps.net` or `hcpapps.net`. + +When MGC wants to create the DNS Records for a host, it will create them in the most exactly matching ManagedZone. +e.g. given the zones `hcpapps.net` and `api.hcpapps.net` the DNS Records for the host `test.api.hcpapps.net` will be created in the `api.hcpapps.net` zone. + +### Delegation +Delegation allows you to give control of a subdomain of a root domain to MGC while the root domain has it's DNS zone elsewhere. + +In the scenario where a root domain has a zone outside Route53, e.g. `external.com`, and a ManagedZone for `delegated.external.com` is required, the following steps can be taken: +- Create the ManagedZone for `delegated.external.com` and wait until the status is updated with an array of nameservers (e.g. `ns1.hcpapps.net`, `ns2.hcpapps.net`). +- Copy these nameservers to your root zone for `external.com`, you can create a NS record for each nameserver against the `delegated.external.com` record. + +For example: +``` +delegated.external.com. 3600 IN NS ns1.hcpapps.net. +delegated.external.com. 3600 IN NS ns2.hcpapps.net. +``` + +Now, when MGC creates a DNS record in it's Route53 zone for `delegated.external.com`, it will be resolved correctly. +### Creating a ManagedZone + +To create a `ManagedZone`, you will first need to create a DNS provider Secret. To create one, see our [DNS Provider](provider.md) setup guide, and make note of your provider's secret name. + + +#### Example ManagedZone +To create a new `ManagedZone` with AWS Route, with a DNS Provider secret named `my-aws-credentials`: + +```bash +kubectl apply -f - <