concept envFrom in category knative
appears as: envFrom

This is an excerpt from Manning's book Knative in Action MEAP V04.
But there are actually two alternative ways of injecting environment variables:
--env-from
/envFrom
andvalueFrom
. What they have in common is that you don’t provide the values of variables directly, andenvFrom
goes further and even does away with providing a name. In both cases the values come from either aConfigMap
or aSecret
.
If you are so inclined, it’s possible to do this in YAML with
envFrom
.Listing 3.31. Using
envFrom
to stamp out environment variablesapiVersion: serving.knative.dev/v1 kind: Configuration metadata: name: values-from-example spec: template: spec: containers: - image: example.com/an/image envFrom: - configMapRef: name: example-configmap - secretRef: name: example-secret