question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unable to run functions in any other namespace than default

See original GitHub issue

So 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:closed
  • Created 4 years ago
  • Comments:10 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
arditdinecommented, Dec 25, 2020

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 from core.services.get => core.ns.services.get If you remove ns it works fine again.

I’ve made a PR for this #228

1reaction
erikedlingcommented, Oct 16, 2019

Absolutely, I might have time to put a PR up this weekend 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why can't I call an function in an anonymous namespace from ...
The problem is that the compiler complains that IsWhiteSpace() was not declared in this scope . But why? Sure, the namespace is anonymous...
Read more >
Unable to access properties of namespace from imported ...
Importing from this module which exports the namespace is as its default export doesn't recognize any of the properties within the namespace ......
Read more >
XML Schema: Understanding Namespaces - Oracle
Moving to XML Schema? This introduction to namespaces will help you understand one of its more important elements.
Read more >
Admission Controllers Reference - Kubernetes
This admission controller checks all requests on namespaced resources other than Namespace itself. If the namespace referenced from a request ...
Read more >
using directive - C# Reference - Microsoft Learn
The static modifier imports the static members and nested types from a single type rather than importing all the types in a namespace....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found