Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: data injection #2668

Merged
merged 1 commit into from
Jun 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading