Nova Docker hypervisor should support env variables

Registered by Daniel Kuffner on 2013-12-15

A common pattern in docker is to use environment variables to configure a container. This is not possible with the nova docker driver. We could provide a simple way to provide this feature by using the nova instance metadata. For example each metadata entry which is prefixed with ENV_ or DOCKER_ could be injected as environment variable into the container.

Blueprint information

Status:
Not started
Approver:
Russell Bryant
Priority:
Undefined
Drafter:
Daniel Kuffner
Direction:
Needs approval
Assignee:
Daniel Kuffner
Definition:
Drafting
Series goal:
None
Implementation:
Unknown
Milestone target:
None

Related branches

Sprints

Whiteboard

Metadata entry which is prefixed with ENV_ could be injected as environment variable into a container.
Example:

    ENV_SQL_URL=postgres://user:password@10.0.0.4/db

would be available inside the container as:

    echo $SQL_URL

The metadata approach has the disadvantage that it is not possible to set it in horizon directly but heat automation can make good use of it. Example Heat template:

myapp:
    Type: OS::Nova::Server
    Properties:
      flavor: m1.small
      image: my-app:latest
      meta-data:
        - ENV_SQL_URL: postgres://user:password@/db
        - ENV_SOMETHING_ELSE: Value

http://lists.openstack.org/pipermail/openstack-dev/2013-December/022346.htmlMetadata entry which is prefixed with ENV_ could be injected as environment variable into a container.
Example:

    ENV_SQL_URL=postgres://user:password@10.0.0.4/db

would be available inside the container as:

    echo $SQL_URL

The metadata approach has the disadvantage that it is not possible to set it in horizon directly but heat automation can make good use of it. Example Heat template:

myapp:
    Type: OS::Nova::Server
    Properties:
      flavor: m1.small
      image: my-app:latest
      meta-data:
        - ENV_SQL_URL: postgres://user:password@/db
        - ENV_SOMETHING_ELSE: Value

http://lists.openstack.org/pipermail/openstack-dev/2013-December/022346.html

Marking this blueprint as definition: Drafting. If you are still working on this, please re-submit via nova-specs. If not, please mark as obsolete, and add a quick comment to describe why. --johnthetubaguy (20th April 2014)

(?)

Work Items

This blueprint contains Public information 
Everyone can see this information.