Skip to content


This example shows Zarf’s ability to inject data into a container running in a pod, in this case to initialize a Kiwix server to allow offline viewing of documentation and wiki pages.

Data injections allow for data that is not included in the container image to be injected at deploy time and are declared using the dataInjections key within a component. Once the specified container is started, Zarf will copy the files and folders from the specified source into the specified container and path.

kind: ZarfPackageConfig
name: kiwix
description: Demo Zarf data injection with Kiwix (
# (optional) Some large datasets may already be compressed making Zarf compression less efficient
uncompressed: true
version: 3.5.0
- name: kiwix-serve
required: true
- name: kiwix-serve
namespace: kiwix
- manifests/persistence.yaml
- manifests/deployment.yaml
- manifests/service.yaml
- alpine:3.18
# Add new data into the cluster, these will keep trying up until their timeout
# Injection in the data directory using the data-loader init container
- source: zim-data
namespace: kiwix
selector: app=kiwix-serve
container: data-loader
path: /data
compress: true
# Download a .zim file of a DevOps Stack Exchange snapshot into the data directory for use with Kiwix
- cmd: curl
-o zim-data/devops.stackexchange.com_en_all_2023-05.zim
# Below are some more examples of *.zim files of available content:
# NOTE: If `zarf package create`ing regularly you should mirror content to a web host you control to be a friendly neighbor
# YAML keys starting with `x-` are custom keys that are ignored by the Zarf CLI
# The `x-mdx` key is used to render the markdown content for