serverless / serverless-knative

Serverless Knative Provider Plugin – Adds Knative to the Serverless Framework
https://serverless.com
28 stars 19 forks source link

Allow use of env variable for Kubernetes namespace #6

Closed madziaf closed 4 years ago

madziaf commented 4 years ago

Currently, the Serverless Framework creates a specific Kubernetes namespace starting with sls- and that is a little limiting. This change would allow users to set the env var KUBE_NAMESPACE to overwrite the default and use the Kubernetes namespace they have already defined.

medikoo commented 4 years ago

@madziaf great thanks for that request!

@pmuens I see, that intention from beginning was to enable modifications of those: https://github.com/serverless/serverless-knative/blob/dabca21e7311466ad84deac1e811da36c1a96fd5/shared/utils.js#L3-L4

Still, shouldn't it be done naturally via some plugin settings in serverless.yml ?

madziaf commented 4 years ago

Thank you @medikoo and @pmuens. Yes, agreed, it would be great to be able to configure the namespace in serverless.yml. Are you planning to work on that? Otherwise I could possibly spend some time on that, but I would need some directions.

medikoo commented 4 years ago

Otherwise I could possibly spend some time on that, but I would need some directions.

@madziaf Best would be to support injection of those options via custom.knative, it's pretty straightforward to implement, you may take hint from this plugin: https://github.com/medikoo/serverless-plugin-reducer/blob/174383e93bb084caed98ee5b45a0eb3e4b6b286b/index.js#L14

madziaf commented 4 years ago

hi @medikoo, pushed the changes, is it the right direction?

alexives commented 4 years ago

@pmuens Any update here? I'd love to be able to use these changes!

pmuens commented 4 years ago

@madziaf @alexives I just published a new version to npm