Skip to content

OnPublicNetworkEnricher config with sensor#379

Merged
asfgit merged 2 commits intoapache:masterfrom
aledsage:OnPublicNetworkEnricher-config-with-sensor
Oct 12, 2016
Merged

OnPublicNetworkEnricher config with sensor#379
asfgit merged 2 commits intoapache:masterfrom
aledsage:OnPublicNetworkEnricher-config-with-sensor

Conversation

@aledsage
Copy link
Copy Markdown
Contributor

@aledsage aledsage commented Oct 11, 2016

I'm not entirely sure what the best way is to wire in and use the OnPublicNetworkEnricher. Two of the use-cases are:

  1. in an environment with port-mappings (e.g. cloud's DNAT, or docker), look up the registered port mapping in the PortForwardManager. This is the existing behaviour.
  2. Where a sensor (e.g. URI or hostAndPort) has been published with the subnet-address, publish an equivalent sensor using the public IP (so using the same port).

It is this second use-case that this PR enables.

For "normal clouds" (i.e. without DNAT), then option 2 is an obvious way to go. However:

  • what if there isn't a public address? The "host.address" sensor would normally be populated with the private ip instead, so that would be used for the public url - but is that too misleading for a value of main.uri.mapped.public?
  • what if there really is a DNAT rule set up for accessing this VM's port? Should our OnPublicNetworkEnricher prefer the DNAT rule (i.e. the entry in PortForwardManager) if it exists, but fall back to the "host.address" if it's not?

If set, it will advertise the public address based on the IP/hostname
advertised in this sensor, rather than using he PortForwardManager.
@neykov
Copy link
Copy Markdown
Member

neykov commented Oct 12, 2016

Nice, merging.

Build failure unrelated and local tests pass.

@asfgit asfgit merged commit 2a4e6ea into apache:master Oct 12, 2016
asfgit pushed a commit that referenced this pull request Oct 12, 2016
OnPublicNetworkEnricher config with sensor

I'm not entirely sure what the best way is to wire in and use the `OnPublicNetworkEnricher`. Two of the use-cases are:

1. in an environment with port-mappings (e.g. cloud's DNAT, or docker), look up the registered port mapping in the `PortForwardManager`. This is the existing behaviour.

2. Where a sensor (e.g. URI or hostAndPort) has been published with the subnet-address, publish an equivalent sensor using the public IP (so using the same port).

It is this second use-case that this PR enables.

For "normal clouds" (i.e. without DNAT), then option 2 is an obvious way to go. However:

* what if there isn't a public address? The "host.address" sensor would normally be populated with the private ip instead, so that would be used for the public url - but is that too misleading for a value of `main.uri.mapped.public`?

* what if there really is a DNAT rule set up for accessing this VM's port? Should our `OnPublicNetworkEnricher` prefer the DNAT rule (i.e. the entry in `PortForwardManager`) if it exists, but fall back to the "host.address" if it's not?
@aledsage aledsage deleted the OnPublicNetworkEnricher-config-with-sensor branch October 12, 2016 11:00
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