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

Allow functions to resolve the core services #134

Open
alexellis opened this issue Dec 3, 2020 · 2 comments
Open

Allow functions to resolve the core services #134

alexellis opened this issue Dec 3, 2020 · 2 comments

Comments

@alexellis
Copy link
Member

alexellis commented Dec 3, 2020

Expected Behaviour

Functions should be able to resolve the core services via name, such as gateway

Current Behaviour

They cannot because the provider has its own /etc/hosts file which is separate from the main faasd process.

Possible Solution

Have the faasd process write the hosts file for the faasd-provider process, or have faasd-provider read from the faasd file.

Steps to Reproduce (for bugs)

  1. Create a new function with a language such as go
  2. Attempt a HTTP GET to a container in the core services such as http://prometheus:9090/
  3. See it fail to resolve

Context

Generally, functions should not call other functions directly but via the gateway

Some functions like in OpenFaaS Cloud call into Prometheus directly, which wouldn't work.

The NATS connector example has a sample workload that publishes a message directly to NATS which won't work with faasd today.

@alexellis alexellis pinned this issue Jan 22, 2021
utsavanand2 added a commit to utsavanand2/faasd that referenced this issue Jan 25, 2021
More details on issue openfaas#134

Signed-off-by: Utsav Anand <utsavanand2@gmail.com>
@alexellis
Copy link
Member Author

For anyone landing here - the ebook referenced in the README has detailed examples for this, effectively for the time being it's best to use the IP of openfaas0 which is a stable IP of: 10.62.0.1.

utsavanand2 added a commit to utsavanand2/faasd that referenced this issue Mar 3, 2021
Mount the hosts file from /var/lib/faasd to the containers

Signed-off-by: Utsav Anand <utsavanand2@gmail.com>
utsavanand2 added a commit to utsavanand2/faasd that referenced this issue Mar 11, 2021
Mount the hosts file from /var/lib/faasd to the containers

Signed-off-by: Utsav Anand <utsavanand2@gmail.com>
@DanielHabenicht
Copy link

Until this is merged I can highly recommend: https://willschenk.com/articles/2021/setting_up_services_with_faasd/

@alexellis alexellis unpinned this issue Sep 15, 2021
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

2 participants