Knative: Operator’s Handbook

Mounting Secrets/ConfigMaps

You can mount Kubernetes Secrets or ConfigMap as either:

While specifying volumes under RevisionSpec part of KService:

Example:

apiVersion: serving.knative.dev/v1alpha1
kind: Service
metadata:
  name: hello
spec:
  template:
    spec:
      volumes:
        - name: secret-vol
          secret:
            secretName: my-secret
        - name: config-vol
          configMap:
            name: my-configmap
      containers:
      - image: gcr.io/google-samples/hello-app:1.0
        volumeMounts:
        - name: secret-vol
          mountPath: /etc/secrets
        - name: config-vol
          mountPath: /etc/config