Inject Environment Variables ​
This tutorial shows how to inject environment variables into Function.
You can specify environment variables in the Function definition, or define references to the Kubernetes Secrets or ConfigMaps.
Prerequisites ​
Before you start, make sure you have these tools installed:
- Serverless module installed in a cluster
Steps ​
Follow these steps:
- Create your ConfigMap
bash
kubectl create configmap my-config --from-literal config-env="I come from config map"- Create your Secret
bash
kubectl create secret generic my-secret --from-literal secret-env="I come from secret"Redis based example ​
For more use cases, see this example