PageRenderTime 71ms CodeModel.GetById 24ms RepoModel.GetById 0ms app.codeStats 0ms

/docs/nulecule.md

https://gitlab.com/gbraad/atomicapp
Markdown | 240 lines | 183 code | 57 blank | 0 comment | 0 complexity | 3827c5afa3c508d13c8e86b6e9691d03 MD5 | raw file
  1. # Nulecule file
  2. Atomic App implements version `0.0.2` of the [Nulecule specification](https://github.com/projectatomic/nulecule/tree/master/spec).
  3. A `Nulecule` file format can either be `json` or `yaml`.
  4. ### Data types
  5. Common Name | `type` | `format` | Comments
  6. ----------- | --------- | ----------- | --------------
  7. integer | `integer` | `int32` | signed 64 bits
  8. float | `number` | `float` |
  9. string | `string` | |
  10. byte | `string` | `byte` |
  11. boolean | `boolean` | |
  12. date | `string` | `date` | As defined by `full-date` - [RFC3339](http://xml2rfc.ietf.org/public/rfc/html/rfc3339.html#anchor14)
  13. dateTime | `string` | `date-time` | As defined by `date-time` - [RFC3339](http://xml2rfc.ietf.org/public/rfc/html/rfc3339.html#anchor14)
  14. password | `string` | `password` | Used to hint UIs the input needs to be obscured.
  15. URL | `URL` | `URL` | As defined by `URL` - [RFC3986 Section 1.1.3](https://tools.ietf.org/html/rfc3986#section-1.1.3)
  16. ### Nulecule file schema
  17. #### Container Application Object
  18. This is the root object for the specification.
  19. Field Name | Type | Description
  20. ---------- | :-----------------: | ------------
  21. id | `string` | **Required.** The machine readable id of the Container Application.
  22. specversion | `string` | **Required.** The semantic version string of the Container Application Specification used to describe the app. The value MUST be `"0.0.2"` (current version of the spec).
  23. metadata | `Metadata Object` | **Optional** An object holding optional metadata related for the Container Application, this may include license information or human readable information.
  24. graph | `Graph Object` | **Required.** A list of depending containerapps. Strings may either match a local sub directory or another containerapp-spec compliant containerapp image that can be pulled via docker.
  25. requirements|`Requirements Object`| **Optional.** A list of requirements of this containerapp.
  26. #### Metadata Object
  27. Metadata for the Container Application.
  28. ##### Fields
  29. Field Name | Type | Description
  30. ---------------|:---------------:| ------------
  31. name | `string` | **Optional.** A human readable name of the containerapp.
  32. appversion | `string` | **Optional.** The semantic version string of the Container Application.
  33. description | `string` | **Optional.** A human readable description of the Container Application. This may contain information for the deployer of the containerapp.
  34. license | `License Object`| **Optional.** The license information for the containerapp.
  35. arbitrary_data | `string` | **Optional.** Arbitrary `key: value` pair(s) of metadata. May contain nested objects.
  36. ##### Metadata Object Example
  37. ```yaml
  38. metadata:
  39. name: myapp
  40. appversion: 1.0.0
  41. description: description of myapp
  42. foo: bar
  43. othermetadata:
  44. foo: bar
  45. files: file://path/to/local/file
  46. ...
  47. ```
  48. #### License Object
  49. License information for the Container Application.
  50. ##### Fields
  51. Field Name | Type | Description
  52. -----------|:--------:|---
  53. name | `string` | **Required.** The human readable license name used for the Container Application, no format imposed.
  54. url | `string` | **Optional.** A URL to the license used for the API. MUST be in the format of a URL.
  55. ##### License Object Example
  56. ```yaml
  57. license:
  58. - name: Apache 2.0
  59. url: http://www.apache.org/licenses/LICENSE-2.0.html
  60. ```
  61. #### Graph Object
  62. The graph is a list of items (containerapps) the Container Application depends on.
  63. ##### Fields
  64. Field Name| Type | Description
  65. ----------|:-----------------:|-------------
  66. name | `string` | **Required.** The name of the depending Container Application.
  67. source | `docker://` | **Optional.** `docker://` source location of the Container Application, the source MUST be prefixed by `docker://`. If source is present, all other fields SHALL be ignored.
  68. params | `Params Object` | **Optional.** A list of `Params Objects` that contain provider specific information. If params is present, source field SHALL be ignored.
  69. artifacts | `Artifact Object` | **Optional.** A list of `Artifact Objects` that contain provider specific information. If artifacts is present, source field SHALL be ignored.
  70. ##### Graph Item Object Example:
  71. ```yaml
  72. params:
  73. - name: mariadb-centos7-atomicapp
  74. source: docker://projectatomic/mariadb-centos7-atomicapp
  75. ...
  76. ```
  77. If no `artifacts` are specified, then an external Atomic App is pulled and installed from the `docker://` source.
  78. #### Parameters Object
  79. A list of Parameters the containerapp requires. Defaults may be set, otherwise user input is required.
  80. ##### Fields
  81. Field Name | Type | Description
  82. ------------|:-----------------:|-------------
  83. name | `string` | **Required.** The name of the parameter.
  84. description | `string` | **Required.** A human readable description of the parameter.
  85. default | `string` | **Optional.** An optional default value for the parameter.
  86. ##### Parameters Object Example:
  87. ```yaml
  88. params:
  89. - name: image
  90. description: wordpress image
  91. default: wordpress
  92. ...
  93. ```
  94. #### Requirements Object
  95. The list of requirements of the Container Application.
  96. Field Name | Type | Description
  97. ---------------- | :-----------------------: | ------------
  98. persistentVolume | `Persisent Volume Object` | **Optional.** An object that holds an array of persistent volumes.
  99. #### Persistent Volume Object
  100. This describes a requirement for persistent, read-only or read-write storage that should be available to the containerapp on runtime. The name of this object MUST be `"persistentVolume"`.
  101. Despite the name, within __Kubernetes__ and __OpenShift__ this acts as a [PersistentVolumeClaim](http://kubernetes.io/v1.1/docs/user-guide/persistent-volumes.html).
  102. Persistent Volume is only available for the following providers: __kubernetes__
  103. ##### Fields
  104. Field Name | Type | Description
  105. ---------------- | :-------: | ------------
  106. name | `string` | **Required.** A name associated with the storage requirement.
  107. accessMode | `string` | **Required.** Must be either: __ReadWriteOnce__, __ReadOnlyMany__ or __ReadWriteMany__.
  108. size | `integer` | **Required.** Size of the volume claim.
  109. ##### Persistent Volume Example
  110. ```yaml
  111. requirements:
  112. - persistentVolume:
  113. name: "var-log-http"
  114. accessMode: "ReadWriteOnce"
  115. size: 4
  116. - persistentVolume:
  117. name: "var-log-https"
  118. accessMode: "ReadOnlyMany"
  119. size: 4
  120. ...
  121. ```
  122. #### Artifacts Object
  123. The Artifacts Object describes a list of provider specific artifact items. These artifact items will be used during the installation of the containerapp to deploy to the provider. Each provider key contains a list of artifacts.
  124. Each artifact is a file location relative to the `Nulecule` file.
  125. __Optionally,__ you may _inherit_ from another compatible provider.
  126. ##### Artifacts Example:
  127. ```yaml
  128. graph:
  129. ...
  130. artifacts:
  131. docker:
  132. - file://artifacts/docker/hello-apache-pod_run
  133. kubernetes:
  134. - file://artifacts/kubernetes/hello-apache-pod.json
  135. openshift:
  136. - inherit:
  137. - kubernetes
  138. ...
  139. ```
  140. # Full example
  141. This is a full example of __all__ features of the Nulecule file. This is only used as an example and _does not necessarily work as intended_.
  142. ```yaml
  143. ---
  144. specversion: 0.0.2
  145. id: helloworld
  146. metadata:
  147. name: Hello World
  148. appversion: 0.0.1
  149. description: Hello earth!
  150. license:
  151. - name: Apache 2.0
  152. url: http://www.apache.org/licenses/LICENSE-2.0.html
  153. foo: bar
  154. othermetadata:
  155. foo: bar
  156. files: file://path/to/local/file
  157. graph:
  158. - name: mariadb-centos7-atomicapp
  159. source: docker://projectatomic/mariadb-centos7-atomicapp
  160. - name: helloapache-app
  161. params:
  162. - name: image
  163. description: The webserver image
  164. default: centos/httpd
  165. - name: hostport
  166. description: The host TCP port as the external endpoint
  167. default: 80
  168. artifacts:
  169. docker:
  170. - file://artifacts/docker/hello-apache-pod_run
  171. kubernetes:
  172. - file://artifacts/kubernetes/hello-apache-pod.json
  173. openshift:
  174. - inherit:
  175. - kubernetes
  176. marathon:
  177. - file://artifacts/marathon/helloapache.json
  178. requirements:
  179. - persistentVolume:
  180. name: "var-log-httpd"
  181. accessMode: "ReadWriteOnce"
  182. size: 4
  183. ```