Knative: Operator’s Handbook

Environment variables

apiVersion: serving.knative.dev/v1alpha1
kind: Service
metadata:
  name: hello
spec:
  template:
    spec:
      containers:
      - image: gcr.io/google-samples/hello-app:1.0
        env:

        # example literal value
        - name: KEY1
          value: "VALUE1"

        # example: mount from Kubernetes ConfigMap
        - name: KEY2
          valueFrom:
            configMapKeyRef:
              name: my-configmap
              key: some-key

        # example: mount from Kubernetes Secret
        - name: KEY3
          valueFrom:
            secretKeyRef:
              name: my-secret
              key: some-key