Unable to run functions in any other namespace than default
See original GitHub issueSo I’m just trying out kubeless through serverless and I’m currently running kubeless in my own namespace. I’m using the env KUBELESS_NAMESPACE
so that the config-map can be found. If I’m deploying the functions in the default namespace, it works fine. However, if I add the field “namespace” in the serverless.yml file in order to deploy the functions in my own namespace as well like so
{
provider:
name: kubeless
namespace: mynamespace
runtime: nodejs6
etc
}
And I run serverless invoke --function capitalize --data '"WELCOME TO KUBELESS!"' -l
. I will get TypeError: opts.log is not a function
in the file serverless-kubeless/lib/invoke.js:128:16
.
If I log the “servicesInfo” variable in the same scope I get the following
{
kind: 'ServiceList',
apiVersion: 'v1',
metadata: {
selfLink: '/api/v1/namespaces/default/services',
resourceVersion: '129499598' },
items: [ { metadata: [Object], spec: [Object], status: [Object] } ]
}
I can see that it uses the default namespace and not the one specified in the serverless.yml file. Am I doing something completely wrong or Is this maybe not supported or is it a bug?
Issue Analytics
- State:
- Created 4 years ago
- Comments:10 (4 by maintainers)
I had the same issue but I noticed that when you create a new serverless project with the command:
serverless create --template kubeless-nodejs --path new-project
works fine, you can deploy in every namespace and can invoke the functions. If you check in package.json it uses serverless-kubeless v0.4.0. I’ve tested and everything works fine up to version 0.6.0 In the new versions of serverless-kubeless it doesn’t work. The only difference I found between versions was that in invoke.js on line 115 the function was changed fromcore.services.get
=>core.ns.services.get
If you removens
it works fine again.I’ve made a PR for this #228
Absolutely, I might have time to put a PR up this weekend 😃