Skip to content

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:

Steps ​

Follow these steps:

  1. Create your ConfigMap
bash
kubectl create configmap my-config --from-literal config-env="I come from config map"
  1. 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