You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/en/docs/score specification/score-spec-reference.md
+70-50Lines changed: 70 additions & 50 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -80,15 +80,15 @@ containers:
80
80
variables: # optional
81
81
VAR_NAME: string
82
82
files: # optional
83
-
- target: string
83
+
target:
84
84
mode: string # optional
85
85
source: string # oneOf source or content is required
86
86
content: string # oneOf source or content is required
87
87
noExpand: boolean # optional
88
88
volumes: # optional
89
-
- source: string
89
+
target:
90
+
source: string
90
91
path: string # optional
91
-
target: string
92
92
readOnly: boolean # optional
93
93
resources: # optional
94
94
limits: # optional
@@ -127,21 +127,48 @@ containers:
127
127
128
128
`variables`: the environment variables for the container. Container variables support both metadata and resource output [placeholders]({{< relref "#placeholder-references" >}}).
129
129
130
-
`files`: the extra files to mount into the container. Either `content`or `source` must be specified along with `target`.
130
+
`files`: the extra files to mount into the container. Either `content`, `binaryContent` or `source` must be specified.
131
131
132
132
- `target`: the file path to expose in the container.
133
-
- `mode`: the optional file access mode in octal encoding. For example 0600.
134
-
- `source`: the relative or absolute path to the content file. File content supports both metadata and resource output [placeholders]({{< relref "#placeholder-references" >}}) unless `noExpand` is true.
135
-
- `content`: the inline content for the file. File content supports both metadata and resource output [placeholders]({{< relref "#placeholder-references" >}}) unless `noExpand` is true.
136
-
- `binaryContent`: base64-encoded inline content for the file. This field supports non-utf-8 bytes for binary or archive files. Placeholder expansion is never supported.
137
-
- `noExpand`: if set to true, the placeholders expansion will not occur in the contents of the `content` or `source` file.
133
+
- `mode`: the optional file access mode in octal encoding. For example 0600.
134
+
- `source`: the relative or absolute path to the content file. File content supports both metadata and resource output [placeholders]({{< relref "#placeholder-references" >}}) unless `noExpand` is true.
135
+
- `content`: the inline content for the file. File content supports both metadata and resource output [placeholders]({{< relref "#placeholder-references" >}}) unless `noExpand` is true.
136
+
- `binaryContent`: base64-encoded inline content for the file. This field supports non-utf-8 bytes for binary or archive files. Placeholder expansion is never supported.
137
+
- `noExpand`: if set to true, the placeholders expansion will not occur in the contents of the `content` or `source` file.
138
+
139
+
Note: Since [`score-compose` `0.28.0`](https://github.com/score-spec/score-compose/releases/tag/0.28.0) and [`score-k8s` `0.5.0`](https://github.com/score-spec/score-k8s/releases/tag/0.5.0), the list of `files` is now a `map` which is the recommended approach moving forward. The previous and other option as an `array`, like illustrated below is still supported for backward compatibility (and may be deprecated in the future).
140
+
141
+
```yaml
142
+
containers:
143
+
container-name:
144
+
...
145
+
files: # optional as an array
146
+
- target: string
147
+
mode: string # optional
148
+
source: string # oneOf source or content is required
149
+
content: string # oneOf source or content is required
150
+
noExpand: boolean # optional
151
+
```
138
152
139
153
`volumes`: the volumes to mount.
140
154
141
-
- `source`: the external volume reference. The volume source supports resource output [placeholders]({{< relref "#placeholder-references" >}}).
142
-
- `path`: an optional sub path in the volume.
143
155
- `target`: the target mount on the container.
144
-
- `readOnly`: indicates if the volume should be mounted in a read-only mode.
156
+
- `source`: the external volume reference. The volume source supports resource output [placeholders]({{< relref "#placeholder-references" >}}).
157
+
- `path`: an optional sub path in the volume.
158
+
- `readOnly`: indicates if the volume should be mounted in a read-only mode.
159
+
160
+
Note: Since [`score-compose` `0.28.0`](https://github.com/score-spec/score-compose/releases/tag/0.28.0) and [`score-k8s` `0.5.0`](https://github.com/score-spec/score-k8s/releases/tag/0.5.0), the list of `volumes` is now a `map` which is the recommended approach moving forward. The previous and other option as an `array`, like illustrated below is still supported for backward compatibility (and may be deprecated in the future).
161
+
162
+
```yaml
163
+
containers:
164
+
container-name:
165
+
...
166
+
volumes: # optional as an array
167
+
- target: string
168
+
source: string
169
+
path: string # optional
170
+
readOnly: boolean # optional
171
+
```
145
172
146
173
`resources`: the compute resources for the container.
147
174
@@ -185,39 +212,39 @@ containers:
185
212
FRIEND: World!
186
213
MESSAGE: Hello ${metadata.name}
187
214
188
-
files: # (Optional) Specifies extra files to mount
189
-
- target: /etc/hello-world/config.yaml # - Target file path and name
path: sub/path# - (Optional) Sub path in the volume
226
+
readOnly: true # - (Optional) Mount as read-only
227
+
228
+
resources: # (Optional) CPU and memory resources needed
229
+
limits: # - (Optional) Maximum allowed
203
230
memory: "128Mi"
204
231
cpu: "500m"
205
-
requests: # - (Optional) Minimal required
232
+
requests: # - (Optional) Minimal required
206
233
memory: "64Mi"
207
234
cpu: "250m"
208
235
209
-
livenessProbe: # (Optional) Liveness probe
210
-
httpGet: # - Only HTTP GET is supported
211
-
scheme: http # - Specify the schema (http or https)
236
+
livenessProbe: # (Optional) Liveness probe
237
+
httpGet: # - Only HTTP GET is supported
238
+
scheme: http # - Specify the schema (http or https)
212
239
path: /alive
213
240
port: 8080
214
241
215
-
readinessProbe: # (Optional) Readiness probe
216
-
httpGet: # - Only HTTP GET is supported
217
-
scheme: http # - Specify the schema (http or https)
242
+
readinessProbe: # (Optional) Readiness probe
243
+
httpGet: # - Only HTTP GET is supported
244
+
scheme: http # - Specify the schema (http or https)
218
245
path: /ready
219
246
port: 8080
220
-
httpHeaders: # - (Optional) HTTP Headers to include
247
+
httpHeaders: # - (Optional) HTTP Headers to include
221
248
- name: Custom-Header
222
249
value: Awesome
223
250
```
@@ -323,23 +350,16 @@ resources:
323
350
type: postgres
324
351
```
325
352
326
-
### Reserved resource types
327
-
328
-
In general, the Score specification does not specify a set of supported `resource types or outputs of those resources however there are some types that have historical significance in some Score implementations that you may want to be aware of.
329
-
330
-
- `environment`: This resource type is a source of environment specific values. In `score-compose` this comes from environment variables present when running `score-compose generate`, in Humanitec this comes from the deployed environment configuration. In `score-k8s` this has no specific meaning.
331
-
- `volume`: This resource type should be used with the container volume source field. This is generally implementation specific due to the varied behavior and configuration of mounted volumes.
332
-
- `service`: This resource type is used in Humanitec to return service placeholders. It has no specific meaning in `score-compose` or `score-k8s`.
333
-
334
353
## Placeholder References
335
354
336
355
Score Workloads support `${..}` placeholder references in order to support dynamic configuration within the Workload. Placeholders operate within the context of their Workload and can be used to interpolate values from either Workload metadata or the outputs of named resources. References to unknown keys will result in a failure. The `${}` syntax can be escaped with an additional dollar sign, for example: `$${not a placeholder}`and any `.`'s in a key can be escaped with a backslash: `${some\.thing}`.
337
356
338
357
Placeholders are supported in the following locations:
339
358
340
359
- `containers.*.variables.*`: The value of a variable may contain one or more placeholders.
341
-
- `containers.*.files[*].content`: The inline content of a file may contain one or more placeholders.
342
-
- `containers.*.volumes[*].source`: The volume source may contain placeholders. This usually refers to a particular named resource of type `volume`.
360
+
- `containers.*.files.*.content`: The inline content of a file may contain one or more placeholders.
361
+
- `containers.*.files.*.source`: The file source may contain one or more placeholders.
362
+
- `containers.*.volumes.*.source`: The volume source may contain placeholders. This usually refers to a particular named resource of type `volume`.
343
363
- `resources.*.params.*`: The resource params may accept placeholder resolutions.
0 commit comments