Skip to content

Commit

Permalink
feat(kraftfile): Information about specifying top-level env attr
Browse files Browse the repository at this point in the history
Signed-off-by: Alexander Jung <[email protected]>
  • Loading branch information
nderjung committed Jan 29, 2025
1 parent bcfeabc commit 2785fa9
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions content/docs/cli/reference/kraftfile/v0.6.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,44 @@ cmd:
```


## Top-level `env` attribute

An `env` attribute CAN be provided which injects environmental variables to the application.

Compared to when specifying them in the `cmd` attribute (as seen in [specifying kernel parameters](#specifying-kernel-parameters)), using the `env` attribute is a lot more context-aware.
`kraft` recognizes where it can be best injected, for example, embedded as static variables during build-time, as OCI environmental variables when packaging, as command-line arguments, etc.

### Specified as a list

```yaml ln={3-5,4}
spec: v0.6
env:
- HOME=/
```

### Specified as a dictionary

```yaml ln={3-5,4}
spec: v0.6
env:
HOME: /
```


## Top-level `labels` attribute

A `labels` attribute CAN be specified which injects arbitrary key-value labels which are set during the packaging step:

```yaml ln={3-5,7-9}
spec: v0.6
labels:
key: value
```


## Top-level `volumes` attribute

<Info>
Expand Down

0 comments on commit 2785fa9

Please sign in to comment.