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

FEATURE: Adding dynamic aliases to nomad/pot/potnet stack in order to have consul checking aliases as address #55

Open
einsiedlerkrebs opened this issue Apr 30, 2024 · 0 comments

Comments

@einsiedlerkrebs
Copy link
Contributor

When using a setup where consul and nomad are on the same hosts, I wasn't able to check services with consul on the same host, therefore aren't able to announce them via its DNS as long as they are on the same host. (see #53 )
This could have been overcome by:

  • patching firewall rules -> having different redirects from EXT_IF:PORT to epairIF:PORT
  • having "localhost_tunnel" feature enabled -> additional ncat process.

Both solutions felt to indirect, since the service is just there at the other IPAddr. The circumstances where this is not working is only if the other service is on the same host. nomad-pot/consul are working fine, where the request originates some where else. It is understood that using the setup on a single host is somewhat not intended in the design. But still having nomad describe and schedule jobs and consul check them is still a nice feature and it keeps the upgrade path to a horizontal scaling at hand.

While trying to identifying the best angle to getting the functionality and where a service can be announuced to another pot without knowing its allocId, aliases/roles for service names where thought of. Roles as an alias for the _ which nomad-pot uses for hostname and enters the /etc/hosts. Goal is to have such as $NOMAD_TASK_NAME as hostname alias.

    task "proxy" {
      driver = "pot"
      service { address = "${NOMAD_TASK_NAME}.local" }

Digging into the code of pot parts of that feature could be found:

pot.attr.hosts (pot set-hosts) in the configuration of a pot is actually there to hold additionally host configuration.
This can be used to announce a service own dynamic IP with it service name
potnet etc-hosts is used anyways, but didn't include the pot.attr.hosts configurations.

potnet is used to generate the /etc/hosts files inside a pot. And releases the next free IPAddr.
pot drives everything stateless, except of configuration files. This is utilized from nomad-pot-driver.
pot. Takes the nomad job description and forwards it to pot, via prepare and start. Configuration takes place with pots command tooling. Sadly nomad-pot-driver does not seem to be aware of the IPAddr of a pot.

With the following features were missing:

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

No branches or pull requests

1 participant