concept envFrom in category knative

appears as: envFrom
Knative in Action MEAP V04

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 and valueFrom. What they have in common is that you don’t provide the values of variables directly, and envFrom goes further and even does away with providing a name. In both cases the values come from either a ConfigMap or a Secret.

If you are so inclined, it’s possible to do this in YAML with envFrom.

Listing 3.31. Using envFrom to stamp out environment variables
apiVersion: 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
sitemap

Unable to load book!

The book could not be loaded.

(try again in a couple of minutes)

manning.com homepage
test yourself with a liveTest