Skip to content

Latest commit

 

History

History
30 lines (26 loc) · 624 Bytes

builds-using-secrets-as-environment-variables.adoc

File metadata and controls

30 lines (26 loc) · 624 Bytes

Using secrets as environment variables

You can make key values from Secrets available as environment variables using the valueFrom syntax.

Procedure
  • To use a secret as an environment variable, set the valueFrom syntax:

    apiVersion: v1
    kind: BuildConfig
    metadata:
      name: secret-example-bc
    spec:
      strategy:
        sourceStrategy:
          env:
          - name: MYVAL
            valueFrom:
              secretKeyRef:
                key: myval
                name: mysecret