Skip to content

Commit

Permalink
data injection docs
Browse files Browse the repository at this point in the history
  • Loading branch information
AustinAbro321 committed Jun 26, 2024
1 parent a095700 commit 0c6ad98
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
1 change: 1 addition & 0 deletions examples/kiwix/manifests/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ spec:
app: kiwix-serve
spec:
# Kiwix can hot-load files from the filesystem, but if your application cannot, this example shows how you can use an initContainer to bootstrap the injected files.
# It's necessary to include the ###ZARF_DATA_INJECTION_MARKER### somewhere in the podspec, otherwise data injections will not occur.
initContainers:
- name: data-loader
image: alpine:3.18
Expand Down
10 changes: 7 additions & 3 deletions site/src/content/docs/ref/components.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ These components define what dependencies they have along with a declarative def

Each package can have as many components as the package creator wants but a package isn't anything without at least one component.

{/*
{/*
## What can be Packaged?
The following types of software can be rolled into a Zarf Package:
Expand Down Expand Up @@ -141,10 +141,10 @@ Images can either be discovered manually, or automatically by using [`zarf dev f

### Git Repositories

The [`podinfo-flux`](/ref/examples/podinfo-flux/) example showcases a simple GitOps workflow using Flux and Zarf.

<Properties item="ZarfComponent" include={["repos"]} />

The [`podinfo-flux`](/ref/examples/podinfo-flux/) example showcases a simple GitOps workflow using Flux and Zarf.

<Tabs>
<TabItem label="Full Mirror">
<ExampleYAML src={import("../../../../../examples/git-data/zarf.yaml?raw")} component="full-repo" />
Expand Down Expand Up @@ -208,6 +208,10 @@ Git repositories included in a package can be deployed with `zarf package deploy

<Properties item="ZarfComponent" include={["dataInjections"]} />

During `zarf package create`, data injections pull files from the host at the path specified by the `source` key. During `zarf package deploy`, these files are injected into the container specified by the `target` key. The pod holding the targeted container must have the variable `###ZARF_DATA_INJECTION_MARKER###` within the pod spec otherwise the data injection will not occur. This variable gets templated at deploy time to become the name of the extra file Zarf injects into the pod to signify that the data injection is complete.

The [`kiwix`](/ref/examples/kiwix/) example showcases a simple data injection use case.

<ExampleYAML src={import("../../../../../examples/kiwix/zarf.yaml?raw")} component="kiwix-serve" />

### Component Imports
Expand Down

0 comments on commit 0c6ad98

Please sign in to comment.