Merge "Adding application definition language doc"

This commit is contained in:
Jenkins 2016-07-21 09:26:05 +00:00 committed by Gerrit Code Review
commit bbc090fa10
2 changed files with 209 additions and 0 deletions

208
doc/source/dsl.rst Normal file
View File

@ -0,0 +1,208 @@
===============================
Application definition language
===============================
There is a description of current syntax of application definition framework.
Application definition template
-------------------------------
.. sourcecode:: yaml
service:
name: service-name
ports:
- internal-port:external-port
daemonset: true
host-net: true
node-selector:
openstack-controller: "true"
openstack-compute: "true"
containers:
- name: container-name
image: container-image
probes:
readiness: readiness.sh
liveness: liveness.sh
volumes:
- name: volume-name
type: host
path: /path
pre:
- name: service-bootstrap
dependencies:
- some-service
- some-other-service
type: single
command: /tmp/bootstrap.sh
files:
- bootstrap.sh
user: user
- name: db-sync
dependencies:
- some-dep
command: some command
user: user
daemon:
dependencies:
- demon-dep
command: daemon.sh
files:
- config.conf
user: user
post:
- name: post-command
dependencies:
- some-service
- some-other-service
type: single
command: post.sh
files:
- config.conf
files:
config.conf:
path: /etc/service/config.conf
content: config.conf.j2
perm: "0600"
user: user
bootstrap.sh:
path: /tmp/bootstrap.sh
content: bootstrap.sh.j2
perm: "0755"
Parameters description
----------------------
.. _service:
**service**
+---------------+-----------------------------------------------+----------+------------------+---------+
| Name | Description | Required | Schema | Default |
+===============+===============================================+==========+==================+=========+
| name | Name of the service. | true | string | |
+---------------+-----------------------------------------------+----------+------------------+---------+
| containers | List of containers under multi-container pod | true | container_ array | |
+---------------+-----------------------------------------------+----------+------------------+---------+
| ports | k8s Service will be created if specified | false | internal-port: | |
| | (with NodePort type for now) | | external-port | |
| | Only internal or both internal:external ports | | array | |
| | can be specified | | | |
+---------------+-----------------------------------------------+----------+------------------+---------+
| node-selector | | false | array of labels | |
+---------------+-----------------------------------------------+----------+------------------+---------+
| daemonset | Create DaemonSet instead of Deployment | false | boolean | false |
+---------------+-----------------------------------------------+----------+------------------+---------+
| host-net | | false | boolean | false |
+---------------+-----------------------------------------------+----------+------------------+---------+
.. _container:
**container**
+---------+--------------------------------------------+----------+------------------+---------+
| Name | Description | Required | Schema | Default |
+=========+============================================+==========+==================+=========+
| name | Name of the container. It will be used to | true | string | |
| | track status in etcd | | | |
+---------+--------------------------------------------+----------+------------------+---------+
| image | Name of the image. registry, namespace, | true | string | |
| | tag will be added by framework | | | |
+---------+--------------------------------------------+----------+------------------+---------+
| probes | Readiness, liveness or both checks can be | false | dict with | |
| | defined. Exec action will be used for both | | two keys: | |
| | checks | | liveness: cmd | |
| | | | readiness: cmd | |
+---------+--------------------------------------------+----------+------------------+---------+
| volumes | | false | volume_ array | |
+---------+--------------------------------------------+----------+------------------+---------+
| pre | List of commands that need to be executed | false | command_ array | |
| | before daemon process start | | | |
+---------+--------------------------------------------+----------+------------------+---------+
| daemon | | true | command_ | |
+---------+--------------------------------------------+----------+------------------+---------+
| post | The same as for “pre” except that post | false | command_ array | |
| | commands will be executed after daemon | | | |
| | process has been started | | | |
+---------+--------------------------------------------+----------+------------------+---------+
.. _volume:
**volume**
+------------+-------------------------------------------+----------+-----------------------+---------+
| Name | Description | Required | Schema | Default |
+============+===========================================+==========+=======================+=========+
| name | Name of the volume | true | string | |
+------------+-------------------------------------------+----------+-----------------------+---------+
| type | host and empty-dir type supported for now | true | one of: | |
| | | | ["host", "empty-dir"] | |
+------------+-------------------------------------------+----------+-----------------------+---------+
| path | Host path that should be mounted | false | string | |
| | (only if type = "host") | | | |
+------------+-------------------------------------------+----------+-----------------------+---------+
| mount-path | Mount path in container | false | string | path |
+------------+-------------------------------------------+----------+-----------------------+---------+
.. _command:
**command**
+--------------+--------------------------------------------+----------+----------------------+---------+
| Name | Description | Required | Schema | Default |
+==============+============================================+==========+======================+=========+
| name | Name of the command | true | string | |
+--------------+--------------------------------------------+----------+----------------------+---------+
| command | | true | string | |
+--------------+--------------------------------------------+----------+----------------------+---------+
| dependencies | These keys will be polled from etcd | false | string array | |
| | before commands execution | | | |
+--------------+--------------------------------------------+----------+----------------------+---------+
| type | type: single means that this command | false | one of: | local |
| | should be executed once per openstack | | ["single", "local"] | |
| | deployment. For commands with | | | |
| | type: single Job object will be created | | | |
| | | | | |
| | type: local (or if type is not specified) | | | |
| | means that command will be executed | | | |
| | inside the same container as a | | | |
| | daemon process. | | | |
+--------------+--------------------------------------------+----------+----------------------+---------+
| files | List of the files that maps to the keys | false | file_ keys array | |
| | of files dict. It defines which files will | | | |
| | be rendered inside a container | | | |
+--------------+--------------------------------------------+----------+----------------------+---------+
| user | | false | string | |
+--------------+--------------------------------------------+----------+----------------------+---------+
.. _files:
**files**
+------------------------------+-------------+----------+-------------+---------+
| Name | Description | Required | Schema | Default |
+==============================+=============+==========+=============+=========+
| Name of the file to refer in | | false | file_ array | |
| files list of commands | | | | |
+------------------------------+-------------+----------+-------------+---------+
.. _file:
**file**
+---------+------------------------------------------------+----------+--------+---------+
| Name | Description | Required | Schema | Default |
+=========+================================================+==========+========+=========+
| path | Destination path inside a container | true | string | |
+---------+------------------------------------------------+----------+--------+---------+
| content | Name of the file under | true | string | |
| | {{ service_repo }}/service/files directory. | | | |
| | This file will be rendered inside a container | | | |
| | and moved to the destination defined with path | | | |
+---------+------------------------------------------------+----------+--------+---------+
| perm | | false | string | |
+---------+------------------------------------------------+----------+--------+---------+
| user | | false | string | |
+---------+------------------------------------------------+----------+--------+---------+

View File

@ -15,6 +15,7 @@ Contents:
installation installation
usage usage
contributing contributing
dsl
Indices and tables Indices and tables
================== ==================