Open juanxhos opened 4 years ago
My test escenario https://github.com/jcalonsoh/test-kubeless
mm, I am not able to reproduce your issue, are you using an HTTP trigger?
In my case, I have deployed the sample nodejs function and a simple HTTP trigger:
▶ kubeless function deploy get-nodejs --runtime nodejs6 --handler helloget.foo --from-file nodejs/helloget.js
▶ kubeless trigger http create get-nodejs --function-name get-nodejs
I can see the path logged when I am doing requests:
▶ curl -H "Host: get-nodejs.127.0.0.1.nip.io" localhost:30080/foobar
hello world!%
▶ kubectl logs get-nodejs-5bd7c8848b-hz5pf | grep foobar
url: '/foobar',
originalUrl: '/foobar',
url: '/foobar',
originalUrl: '/foobar',
pathname: '/foobar',
path: '/foobar',
href: '/foobar',
_raw: '/foobar' },
params: { '0': '/foobar' },
url: '/foobar',
originalUrl: '/foobar',
::ffff:10.244.0.5 - - [05/Mar/2020:10:48:42 +0000] "GET /foobar HTTP/1.1" 200 - "-" "curl/7.58.0"
mm, I am not able to reproduce your issue, are you using an HTTP trigger?
In my case, I have deployed the sample nodejs function and a simple HTTP trigger:
▶ kubeless function deploy get-nodejs --runtime nodejs6 --handler helloget.foo --from-file nodejs/helloget.js ▶ kubeless trigger http create get-nodejs --function-name get-nodejs
I can see the path logged when I am doing requests:
▶ curl -H "Host: get-nodejs.127.0.0.1.nip.io" localhost:30080/foobar hello world!% ▶ kubectl logs get-nodejs-5bd7c8848b-hz5pf | grep foobar url: '/foobar', originalUrl: '/foobar', url: '/foobar', originalUrl: '/foobar', pathname: '/foobar', path: '/foobar', href: '/foobar', _raw: '/foobar' }, params: { '0': '/foobar' }, url: '/foobar', originalUrl: '/foobar', ::ffff:10.244.0.5 - - [05/Mar/2020:10:48:42 +0000] "GET /foobar HTTP/1.1" 200 - "-" "curl/7.58.0"
can you share your repo, please and what version are you using ??
I am using the helloget example from this repo (I only added a console.log
of the request to print more info):
https://github.com/kubeless/runtimes/blob/master/stable/nodejs/examples/helloget.js
I am using kubeless 1.0.6.
In your case, I believe it's an issue with the HTTP trigger/ingress configuration. How did you create it? What ingress controller are you using?
Thanks I found out the problem, it's on plugin serverless-kubeless
https://github.com/serverless/serverless-kubeless/blob/master/lib/deploy.js#L533
looks like there is no definition function to create HTTPTrigger
apiVersion: kubeless.io/v1beta1
kind: HTTPTrigger
metadata:
name: cors-trigger
annotations:
nginx.ingress.kubernetes.io/enable-cors: "true"
nginx.ingress.kubernetes.io/cors-allow-methods: "GET"
spec:
function-name: get-python
host-name: example.com
path: echo
I know there are 3 types of httptrigger, but at least can do something for at least nginx default type ?
Ah, yes, the serverless-kubeless creates an Ingress resource directly rather than creating an HTTP Trigger (which is the Kubeless abstraction). I recommend you to use the kubeless
CLI to create the HTTP trigger since the serverless plugin is a bit behind regarding functionality.
In any case we are open to contributions for any project in case anyone wants to fix the issue there.
Nice... I am looking forward. Better if you have a Doc to setup an dev env for help on issues.
We have a bit of documentation for the Kubeless main project (https://kubeless.io/docs/dev-guide/) but unfortunately not here
Is this a BUG REPORT or FEATURE REQUEST?: BUG REPORT
What happened: When I send request with path ping using kubeless.js middleware it send / instead of the path
What you expected to happen: to send the path requested
How to reproduce it (as minimally and precisely as possible): curl --header "Host: kubernetes.docker.internal.nip.io" localhost/ping and logs says
on AWS, works fine: because there is path sending...
Anything else we need to know?:
I found out in runtime: https://github.com/kubeless/runtimes/blob/master/stable/nodejs/lib/helper.js#L38-L50 there no funtion for * I would expect something like:
I do not know if it works
Environment: