Environmental Variables in Fission

1/4/2018

Is there a way to set environment variables in fission? I can't seem to find anything on their documentation and do not want to put credentials in the codebase.

I wasn't sure if it would make sense to add it as a build variable but don't know how that would work with the cli.

-- Joel Holmes
kubernetes-fission

2 Answers

12/3/2018

I think a good way to store the credentials would be storing them in the K8S cluster in ConfigMap resources and the accessing the in our code. You can follow this link to read more about how to access the configmap from fission code.

-- viveksinghggits
Source: StackOverflow

1/4/2018

As far as I know of the support for environment variables is being worked on. The relevant PR: https://github.com/fission/fission/pull/399

As a temporary workaround you could inject environment variables using a custom Fission environment. For example with the python environment:

FROM fission/python-env

ENV DB_CREDENTIALS=foobar

ENTRYPOINT ["python3"]
CMD ["server.py"]

Note that any function using the custom environment will have access to the environment variable(!)

-- Erwin
Source: StackOverflow