From 2785fa97eef23f4b525273a4033d61b4953144c7 Mon Sep 17 00:00:00 2001 From: Alexander Jung Date: Wed, 29 Jan 2025 10:29:50 +0100 Subject: [PATCH] feat(kraftfile): Information about specifying top-level `env` attr Signed-off-by: Alexander Jung --- content/docs/cli/reference/kraftfile/v0.6.mdx | 38 +++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/content/docs/cli/reference/kraftfile/v0.6.mdx b/content/docs/cli/reference/kraftfile/v0.6.mdx index a225809a..cd0f1cc1 100644 --- a/content/docs/cli/reference/kraftfile/v0.6.mdx +++ b/content/docs/cli/reference/kraftfile/v0.6.mdx @@ -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