Workload files¶
Ankaios supports mapping files to workloads. The user can define files in the files field of a workload configuration, which supports text and base64 encoded content. The files are mounted in readonly mode. Workload files are not supported for a workload with runtime podman-kube. Instead, use the built-in ConfigMaps feature of podman-kube.
The following manifest contains a workload with a mounted web server configuration and another workload which outputs the content of a mounted base64 encoded file to the terminal. It also combines the config object approach with workload files by defining the configuration separated from the workload. Ankaios expands the templated subfields data and binaryData using the handlebars template engine.
To get an overview about which workload configuration fields currently support template expansion, see here.
-
The contents of the
datafield will be expanded and replaced with the custom web server configuration ofnginx_configpart of theconfigsfield below. -
The contents of the
binaryDatafield will be expanded and replaced with the content ofbin_datapart of theconfigsfield below.
Note
Ankaios expects base64 data in the Standard Base64 Encoding including padding according to RFC 4648. Example: echo -n "Hello, World!" | base64. Ankaios decodes the base64 data before mounting the file to the workload.