Bug 1402468 - [RFE] Environment Variables in BuildConfig
Summary: [RFE] Environment Variables in BuildConfig
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: RFE
Version: 3.3.0
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
: ---
Assignee: Ben Parees
QA Contact: Xiaoli Tian
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-12-07 15:45 UTC by Steven Walter
Modified: 2020-12-14 07:55 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: No Doc Update
Doc Text:
documented RFE, not a bug.
Clone Of:
Environment:
Last Closed: 2017-06-26 14:27:06 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Steven Walter 2016-12-07 15:45:00 UTC
1. Proposed title of this feature request
Environment Variables in BuildConfig

3. What is the nature and description of the request?
"I want to set an environment variable from a secret in a Build Config"
 

4. Why does the customer need this? (List the business requirements here)
Customer wants to be able to set secure information like passwords into environment variables, and does not want them as plaintext outside of the pod (thus needs the secret)
 

5. How would the customer like to achieve this? (List the functional requirements here)
They want to set in buildconfig something like:

strategy:
  sourceStrategy:
    env:
    - name: MAVEN_OPTS
       valueFrom:
          secretKeyRef:
            key: mvnopts
            name: mvnopts

Currently when doing this they get:

* spec.strategy.sourceStrategy.env[2].valueFrom: Invalid value: {"secretKeyRef":{"Name":"mvnopts","key":"mvnopts"}}: valueFrom is not supported in build strategy environment variables
 

6. For each functional requirement listed in question 5, specify how Red Hat and the customer can test to confirm the requirement is successfully implemented.
Make a bc referencing a secret for valueFrom
 

7. Is there already an existing RFE upstream or in Red Hat bugzilla?
http://kubernetes.io/docs/user-guide/secrets/#using-secrets-as-environment-variables

10. List any affected packages or components.
builds, secrets

Comment 3 Michael Epley 2017-05-26 04:26:24 UTC
Should also support config map references; currently fails with similar error:

(spec.strategy.dockerStrategy.env[1].valueFrom: Invalid value: {"configMapKeyRef":{"Name":"name","key":"key"}}: valueFrom is not supported in build strategy environment variables

Works for standard env values, i.e. spec.strategy.dockerStrategy.env[1].value

Comment 4 Ben Parees 2017-05-26 04:34:34 UTC
That is covered in the referenced trello card.

Comment 5 alex toderita 2017-06-26 12:07:11 UTC
Would you have any updates regarding this feature request?

Comment 6 Ben Parees 2017-06-26 14:27:06 UTC
for everything except pipeline strategies, this is being delivered as part of v3.6.


Note You need to log in before you can comment on or make changes to this bug.