serverless / serverless-kubeless

This plugin enables support for Kubeless within the Serverless Framework.
Apache License 2.0
303 stars 80 forks source link

Unable to get serverless working on aks #152

Closed posix4e closed 2 years ago

posix4e commented 6 years ago

By default you don't have permission for my config map even though my kubectl config is properly configured.

serverless deploy -v

/home/posix4e/src/serverlesstest/node_modules/serverless-kubeless/lib/config.js:56
      return JSON.parse(this.configMag.data[key]);
                                           ^
TypeError: Cannot read property 'runtime-images' of undefined
    at Config.get (/home/posix4e/src/serverlesstest/node_modules/serverless-kubeless/lib/config.js:56:44)
    at Object.getRuntimeDepfile (/home/posix4e/src/serverlesstest/node_modules/serverless-kubeless/lib/helpers.js:182:34)
    at ReadStream.s.on (/home/posix4e/src/serverlesstest/node_modules/serverless-kubeless/deploy/kubelessDeploy.js:103:39)
    at ReadStream.emit (events.js:187:15)
    at ReadStream.EventEmitter.emit (domain.js:442:20)
    at endReadableNT (_stream_readable.js:1092:12)
    at process._tickCallback (internal/process/next_tick.js:63:19)

When I run kubectl proxy and hard code the CM to localhost I get

-----------------------------------

Error: Found errors while processing the given functions:
Error: Unable to update the function hello. Received:
  Code: 403
  Message: functions.kubeless.io "hello" is forbidden: User "clusterUser" cannot patch functions.kubeless.io in the namespace "default"
    at Object.checkFinished (/home/posix4e/src/serverlesstest/node_modules/serverless-kubeless/lib/helpers.js:209:14)
    at deployFunction.catch.then (/home/posix4e/src/serverlesstest/node_modules/serverless-kubeless/lib/deploy.js:479:21)
From previous event:
    at PluginManager.invoke (/home/posix4e/.nvm/versions/node/v10.10.0/lib/node_modules/serverless/lib/classes/PluginManager.js:390:22)
    at PluginManager.run (/home/posix4e/.nvm/versions/node/v10.10.0/lib/node_modules/serverless/lib/classes/PluginManager.js:421:17)
    at variables.populateService.then.then (/home/posix4e/.nvm/versions/node/v10.10.0/lib/node_modules/serverless/lib/Serverless.js:157:33)
    at runCallback (timers.js:694:18)
    at tryOnImmediate (timers.js:665:5)
    at processImmediate (timers.js:647:5)
    at process.topLevelDomainCallback (domain.js:121:23)
From previous event:
    at Serverless.run (/home/posix4e/.nvm/versions/node/v10.10.0/lib/node_modules/serverless/lib/Serverless.js:144:8)
    at serverless.init.then (/home/posix4e/.nvm/versions/node/v10.10.0/lib/node_modules/serverless/bin/serverless:43:50)
andresmgot commented 6 years ago

This is the same error than https://github.com/serverless/serverless-kubeless/issues/149#issuecomment-416654147. It's not possible yet to use this plugin with EKS due to the authentication method for that platform. How are you authenticating against you AKS plugin? Do you have RBAC permissions to get the Kubeless configmap in the kubeless namespace?

If this is an authentication issue you can still try to deploy your functions with the kubeless binary: https://github.com/kubeless/kubeless/releases

posix4e commented 6 years ago

@andresmgot I believe it's caused by a different issue

kubectl get cm -n kubeless kubeless-config -o yaml | wc -l 180

Seems to work just fine

andresmgot commented 6 years ago

Yes, the problem is that the javascript library cannot use the exec auth plugin, so that may be the reason.

anaik-zam commented 4 years ago

this was kinda addressed in https://github.com/serverless/serverless-kubeless/pull/189 it works with aws-iam-authenticator, created a PR https://github.com/serverless/serverless-kubeless/pull/192