pmlopes / openfaas-quarkus-native-template

An OpenFAAS template for Quarkus.io serverless native functions
Apache License 2.0
10 stars 12 forks source link

Using faas-cli deploy #8

Open mark-benge opened 2 years ago

mark-benge commented 2 years ago

Deployment fails using faas-cli because Quarkus is trying to use the same port as the OpenFAAS gateway: 2022/06/27 11:57:04 stdout: 2022-06-27 11:57:04,148 ERROR [io.qua.run.Application] (main) Port 8080 seems to be in use by another process. Quarkus may already be running or the port is used by another application.

I can change the quarkus.http.port, but the function I have created will fail with a 500 response, since Quarkus is running on a different port: http://127.0.0.1:8080/function/foo.

Is there a way to route the function request to Quarkus? I have not found anything in the OpenFAAS documentation that would allow the request to be re-routed/re-directed to the Quarkus port.

pmlopes commented 2 years ago

I think we can change the template to use a different port on quarkus.

We can do it at the dockerfile leve with a environment property:

QUARKUS_HTTP_PORT=9000

And then rebind the port to ensure that faas doesn't have a conflict