Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: handle zone type based on prefix zone name #50

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

tferreira11
Copy link

As Google cloud python library on managedzone doesn't have zone type attribute, if we want to handle public / private zones, we could use the zone name if we prefix them with private/public or other as a workaround.

@ross
Copy link
Contributor

ross commented May 24, 2024

If I understand the need here i believe this would more commonly be done as a private flag to the provider and then the main config file would use multiple google cloud providers, one with private=True and another with private=False.

A single source (YamlProvider) that has both as targets would work if all the zones are shared across both. If there are separately public and private zones then two separate sources would work. If there's some private, some public, and some both, then 3 providers. Pretty much any setup you can imagine would be possible.

@tferreira11
Copy link
Author

tferreira11 commented May 27, 2024

In case you have 2 DNS zones for DNS domain example.net, one private and one public on Google cloud, if you have the following naming convention :

  • private-example-net

  • public-example-net

I propose to use a field "zone_prefix" to indicate if it's a private or public DNS zone type:
zone_prefix: private/public

It's a workaround for this issue: #23

@ap0phi5
Copy link

ap0phi5 commented Jun 21, 2024

There is a wider issue with private domains - as you can have multiple VPCs each with their own private zone.
For example, we have 15 DNS zones with the same private domain.

@ross
Copy link
Contributor

ross commented Jun 21, 2024

There is a wider issue with private domains - as you can have multiple VPCs each with their own private zone.
For example, we have 15 DNS zones with the same private domain.

Without knowing specifics it's hard to say exactly what will work, but my first thought is that there'd be 1 config file per VPC with the setup for that VPC configured and octodns-sync would be run/managed individually for them. Any shared data can be in shared yaml files and specific data in specific. See octodns/octodns#1174 (comment) for a recent conversation/example of how that might work.

@ap0phi5
Copy link

ap0phi5 commented Jun 21, 2024

That 1-1 relationship might also cause some issues as you can also have a private zone in use by multiple VPCs. With the Google provider, we may be backed into a corner of having to refer to the zone name as it is the only thing that seems to be unique.

image

The Azure OctoDNS provider went down the route of providing a separate private provider - is that what we may have to do here?

@ross
Copy link
Contributor

ross commented Jun 21, 2024

That 1-1 relationship might also cause some issues as you can also have a private zone in use by multiple VPCs

Again without knowing all the details I can't really spell out an example, but that's where having multiple configs point to a directory of shared zone data can come into play.

If the records are identical, but in a slightly different zone (e.g. with the vpc name in it) a custom YamlProvider that takes vpc as a parameter and knows how to insert it into placeholders in the yaml filenames could take care of that.

The Azure OctoDNS provider went down the route of providing a separate private provider - is that what we may have to do here?

IIRC Azure private DNS has some differences from public and thus required seperate providers. I think some of the other providers just have private/public params, or at they very least there are some with sandbox params that switch where things actually go.

I'm not familar enough with gcloud dns to know what the difference between a private and public dns zone are API-wise and thus know off-hand what direction it needs to take.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants