Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Documentation about using environment variables with Fission functions #81

Open
sanketsudake opened this issue Aug 5, 2021 · 3 comments

Comments

@sanketsudake
Copy link
Member

Users often get confused if they can use environment variables with Fission functions.
Based on yes/no we should document it accordingly and provide samples/details.

@Stradivario
Copy link

I have found out some details about setting up environment variables https://docs.fission.io/docs/usage/function/access-secret-cfgmap-in-function/

I am curious about the part where i need to use file system fs in order to get value from the secrets or config and how does this will reduce the fast bootstrap of the function ? Since every read or write operation cost something and for such a small process to load data using fs on every request sounds a bit slow.

Can someone help me to understand if i am correct or wrong ?

@sanketsudake
Copy link
Member Author

Hi @Stradivario You will have to do to lazyloading for secrets/configmaps values unless you have a requirement of it reading every time.

You will have to read values as per your secret or configmap reference. As mentioned here,
https://docs.fission.io/docs/usage/function/access-secret-cfgmap-in-function/

If you are looking for adding env variables directly currently editing podSpec is one of the way. Though it requires familiarity with Kubernetes and CRDs.
It would go in here.
https://doc.crds.dev/github.com/fission/fission/fission.io/Environment/[email protected]#spec-runtime-podspec-containers-env

We are certainly looking for a native way to inject env variables apart from secret/configmap reference.

@Stradivario
Copy link

Stradivario commented Aug 5, 2021

@sanketsudake thank you for the brief explanation it helps me a lot to understand the actual fission system.

With this approach editing the podSpec sounds cool but it breaks the usage of the platform as Multi Tenant.

What i mean is that if we want every lambda to be configurable per project based we will be in the situation where we have the same environment variables present inside every lambda on every project leading to mixed configurations. So to mitigate this the approach with secrets and configs is more understandable reading them from the file system since that way we can specify different environments per lambda based.

Cheers !

@sanketsudake sanketsudake transferred this issue from fission/docs.fission.io Nov 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants