-
Notifications
You must be signed in to change notification settings - Fork 45
Gateway return function not found when run through traefik #66
Comments
@numkem Can you provide a little more info on how you're invoking the functions? Also, can you provide the gateway env vars and fass-nomad cli params? The way faas-nomad works currently is that it handles the proxying to functions using it's own internal consul resolver using watches. |
+1 I think the Traefik config would help too. |
ConfigurationThis is the traefik configuration, it uses consul's catalog to map a services based on their name to the domain.
This means that a service with the name As for the gateway configuration, I currently have this:
I had to change 2 things from
Running the functionSince I was starting to play with openfaas, I only used the ui through traefik Now if I try to reach them through Since the service is registered in consul I can reach it through traefik at Thank you! |
Hmm, I'm not sure this is what you want since all functions should be invoked through the gateway -> faas-nomad. This looks like you're bypassing the gateway/provider altogether (after the function is deployed) and invoking the functions directly using consul FQDNs with traefik. This will break some behaviour with OpenFaaS - namely auto-scaling. Can you also please post the faas-nomad provider config? |
I know that using traefik to invoke the function isn't the right way to do it. I was just saying that to show that the function works without problems outside from the gateway issue. This is the configuration for
|
Right - just want to be clear. Can you also share some info on your consul configuration? Having trouble reproducing this locally. @nicholasjackson any ideas? |
My consul setup is nothing fancy except I activated the DNS resolver. How is the lookup done in consul? Is it looking for a specific name or tag? |
The lookup is by service name (function name) 1:1 mapping. What you could also try is using the direct_functions feature on the gateway component (you renamed it to faas), like so:
This should resolve requests using the consul domain (FQDN) you've setup but still collect metrics via watchdog. You also need to set the |
What are the steps to reproduce this issue?
faas.hcl
What happens?
Yields a 404
Function not found
What were you expecting to happen?
To get results from the function
Any logs, error output, etc?
Any other comments?
My nomad cluster is pre-built on node that runs CoreOS. HTTP proxy is done with traefik through the
consul_catalog
provider within traeifk. Consul services are exported by their name to a specific domain.I'm not totally sure on how all the pieces works together but the functions are launched through nomad without issues. I also can reach the function itself through traefik because it's service was registered in consul. Trying to use the function through the
/function/<name>
with the gateway doesn't work.What versions of software are you using?
Operating System: CoreOS
OpenFaaS Version: latest with current master of this repo
Nomad Version: 0.8.6
The text was updated successfully, but these errors were encountered: