Adding ability to specify env variables

Env variables will be defined in k8s
form at least for now

example:

containers:
  - name: keystone
    image: keystone
    env:
      - name: MY_POD_NAME
        valueFrom:
          fieldRef:
            fieldPath: metadata.name

Change-Id: I73026ad25e6d80fb7083d6664cb0cb09d6b83386
This commit is contained in:
Andrey Pavlov 2016-08-18 13:55:42 +03:00
parent 09e8840104
commit 1c9b864d78
2 changed files with 8 additions and 0 deletions

View File

@ -122,6 +122,12 @@ Parameters description
| | commands will be executed after daemon | | | |
| | process has been started | | | |
+---------+--------------------------------------------+----------+------------------+---------+
| env | An array of environment variables defined | false | env_ array | |
| | in kubernetes way. | | | |
| | | | | |
+---------+--------------------------------------------+----------+------------------+---------+
.. _env: http://kubernetes.io/docs/api-reference/v1/definitions/#_v1_envvar
.. _volume:

View File

@ -98,6 +98,8 @@ def serialize_daemon_container_spec(container):
}
cont_spec["securityContext"] = {"privileged":
container.get("privileged", False)}
if container.get('env'):
cont_spec['env'] = container['env']
return cont_spec