fnproject / fn-helm

Helm Chart for Fn
Apache License 2.0
56 stars 24 forks source link

`fn inspect function` returns wrong endpoint for function invocation when deployed behind nginx-ingress #46

Closed devcamcar closed 5 years ago

devcamcar commented 5 years ago

nginx-ingress only serves on 80/443 but fn inspect function incorrectly indicates that port 90 should be used:

$ fn inspect function goapp gofn
{
    "annotations": {
        "fnproject.io/fn/invokeEndpoint":   "http://lb.fn.example.com:90/invoke/01D3QMB3Y31BT06BG0A0000002"
    }
    ...
}
denismakogon commented 5 years ago

that’s correct, because you use ingress controller as an HTTP(s) proxy. Port 90 used for internal service routing behind ingress controller.

devcamcar commented 5 years ago

Right, I understand why, but there should be a way to have it send the correct endpoint.

denismakogon commented 5 years ago

Which endpoint you think is correct?

FYI, With an ingress controller you will use HTTP proxy environment variable to talk to Fn deployment. So, given endpoint is correct. Because it’s not the address you are talking to.

denismakogon commented 5 years ago

Going to close this, as per new README (https://github.com/fnproject/fn-helm#exposing-fn-services), with the ingress support as part of the chart you'll have multiple ingress rules created.

In order to talk to those services using their DNS names you'd need to set the ingress controller endpoint as your HTTP proxy:

curl -x http://<ingress-controller-endpoint>:80 api.fn.internal
{"goto":"https://github.com/fnproject/fn","hello":"world!"}