|
| 1 | +# What is Zarf? |
| 2 | + |
| 3 | +<img align="right" alt="zarf logo" src="../.images/zarf-logo.png" width="160" /> |
| 4 | + |
| 5 | +Zarf was created to _**support the declarative creation & distribution of software "packages" into remote / constrained / independent Kubernetes systems**_. |
| 6 | + |
| 7 | +> "Zarf is a tool to help deploy modern stacks into air gapped environments; it's all about moving the bits." — Jeff |
| 8 | +
|
| 9 | +\* Check out our [term list](#what-we-mean-by) below for clarity on all those fancy words. |
| 10 | + |
| 11 | + |
| 12 | + |
| 13 | +## How it helps |
| 14 | + |
| 15 | +Zarf supercharges the way you deliver complex, k8s-native applications to remote systems by reducing tens / hundreds of individual software updates, movements, and manual installations to a few simple terminal commands. Its support comes in two parts: |
| 16 | + |
| 17 | +A precompiled `zarf` binary, which: |
| 18 | + |
| 19 | +- rolls numerous software types / updates into a single distributable package (while on an internet-accessible network), and |
| 20 | + |
| 21 | +- unrolls package contents "into place" for use on production systems (while on an internet-isolated network). |
| 22 | + |
| 23 | +As well as a lightweight, long-running k8s cluster—called "**the Zarf cluster**"—which: |
| 24 | + |
| 25 | +- hosts the services necessary for exposing package contents to your isolated, downstream consumers. |
| 26 | + |
| 27 | + |
| 28 | + |
| 29 | + |
| 30 | +## How it's used (from 30,000 ft) |
| 31 | + |
| 32 | +Zarf is intended for use in a software deployment process that looks something like this: |
| 33 | + |
| 34 | +<a href="../.images/what-is-zarf/how-to-use-it.png"> |
| 35 | + <img alt="how it works" src="../.images/what-is-zarf/how-to-use-it.png" heigth="262" /> |
| 36 | +</a> |
| 37 | + |
| 38 | +### (0) - The internet |
| 39 | + |
| 40 | +Zarf wants to go out into the world to pull & package application software, so 1) the world has to exist, and 2) you need to make sure Zarf can reach the required resources within it (i.e. has a connection to the internet). |
| 41 | + |
| 42 | +That should probably go without saying, but... it's always the "little things" that trip you up, right? |
| 43 | + |
| 44 | +### (1) - Zarf builds you a package |
| 45 | + |
| 46 | +You feed the `zarf` binary a "recipe" (`zarf.yaml`) and it makes itself busy downloading, packing, and compressing the software you asked for. It outputs a single, ready-to-move distributable (cleverly) called "a package". |
| 47 | + |
| 48 | +Find out more about what that looks like in the "[Building a package](#building-a-package)" section. |
| 49 | + |
| 50 | +### (2) - You ship the package |
| 51 | + |
| 52 | +When it comes to remote / constrained / independent / air gapped systems, everyone's unique. Zarf doesn't have an opinion as to _how_ packages move just so long as you can get them into your downstream environment. |
| 53 | + |
| 54 | +Find out more about what that _might_ look like in the "[Shipping a package](#shipping-a-package)" section. |
| 55 | + |
| 56 | +### (3) - Zarf publishes your package |
| 57 | + |
| 58 | +Once your package has landed, depending on what you've built into it, there are a couple of ways for the Zarf cluster to expose package contents: |
| 59 | + |
| 60 | +In the simplest usage scenario, your package consists of a single application (plus dependencies) and you configure the Zarf cluster to _serve your application directly to end users_. This mode of operation is called "Appliance Mode"— because it's small & self-contained like a kitchen appliance—and it is intended for use in environments where you want to run k8s-native tooling but need to keep a small footprint (i.e. single-purpose / constrained / "edge" environments). |
| 61 | + |
| 62 | +Find out more about what direct user service looks like in the "[Appliance Mode](#appliance-mode)" section. |
| 63 | + |
| 64 | +In the standard, more complex usage scenario, your package consists of updates for many apps / systems and you configure the Zarf cluster to _propagate updates to downstream systems_ rather than to serve users directly. This mode of operation is called "Utility Mode"—as it's main job is to _add utility_ to other clusters—and it is intended for use in places where you want to run independent, full-service production environments (your own [Big Bang](https://github.com/DoD-Platform-One/big-bang) cluster, perhaps?) but you need help tracking, caching & disseminating system / dependency updates. |
| 65 | + |
| 66 | +Find out more about what downstream cluster service looks like in the "[Utility Mode](#utility-mode)" section. |
| 67 | + |
| 68 | + |
| 69 | + |
| 70 | + |
| 71 | +## How it's used (from 1,000 ft) |
| 72 | + |
| 73 | +### Building a package |
| 74 | + |
| 75 | +<a href="../.images/what-is-zarf/build-the-package.png"> |
| 76 | + <img alt="how it works" src="../.images/what-is-zarf/build-the-package.png" height="290" /> |
| 77 | +</a> |
| 78 | + |
| 79 | +#### (0) - Identify software to-be-moved |
| 80 | + |
| 81 | +Zarf doesn't build software—it helps you distribute software that already exists. |
| 82 | + |
| 83 | +Zarf can pull from lots of places like [Docker Hub](https://hub.docker.com/), [Iron Bank](./ironbank.md), [GitHub](https://github.com/), local filesystems, etc. but you have to make sure that Zarf has a clear path & appropriate access credentials. Be sure you know what you want pack & how to access it before you Zarf. |
| 84 | + |
| 85 | +Find out more about the types of software Zarf can move in the "[What can be packaged?](#what-can-be-packaged)" section. |
| 86 | + |
| 87 | +#### (1) - Preparation |
| 88 | + |
| 89 | +In order to build a Zarf package, you need to prepare: |
| 90 | + |
| 91 | +- a "packaging" workstation — which must have the `zarf` [CLI tool installed](./workstation.md#just-gimmie-zarf), and |
| 92 | + |
| 93 | +- a `zarf.yaml` file — which tells the Zarf what you need packaged. |
| 94 | + |
| 95 | +Find some detailed uses of the `zarf.yaml` file in [our examples](../examples/). |
| 96 | + |
| 97 | +#### (2) - Package |
| 98 | + |
| 99 | +Actually making a Zarf package out of a `zarf.yaml` file is a matter of calling a single, simple command: `zarf package`. You'll see a `zarf-package-*.tar.zst` file pop into existence afterward—that's your package. |
| 100 | + |
| 101 | +Find out more about that by calling the CLI for help, or check out an example package build in [our game example](../examples/game#package-the-game). |
| 102 | + |
| 103 | + |
| 104 | + |
| 105 | + |
| 106 | +### Shipping a package |
| 107 | + |
| 108 | +<a href="../.images/what-is-zarf/ship-the-package.png"> |
| 109 | + <img alt="how it works" src="../.images/what-is-zarf/ship-the-package.png" height="255" /> |
| 110 | +</a> |
| 111 | + |
| 112 | +What this activity looks like is _very_ situationally specific so Zarf tries not to have an opinion—transfer Zarf packages between production & operating locations using whatever mechanisms are available. |
| 113 | + |
| 114 | +Have to burn your package to disk & "sneakernet" it? That works. |
| 115 | + |
| 116 | +Got an intermittent, super-secret satellite uplink you can use? Awesome. |
| 117 | + |
| 118 | +Can you make a direct network connection? Even better. |
| 119 | + |
| 120 | +Consider the art of the possible and use what you can—Zarf will continue to work, regardless. |
| 121 | + |
| 122 | + |
| 123 | + |
| 124 | + |
| 125 | +### Appliance Mode |
| 126 | + |
| 127 | +<a href="../.images/what-is-zarf/appliance-mode.png"> |
| 128 | + <img alt="how it works" src="../.images/what-is-zarf/appliance-mode.png" height="295" /> |
| 129 | +</a> |
| 130 | + |
| 131 | +#### (0) - Package |
| 132 | + |
| 133 | +Move a Zarf release + your desired packages to your Zarf cluster machine. |
| 134 | + |
| 135 | +#### (1) - Zarf cluster |
| 136 | + |
| 137 | +Make your machine into a **single node** Zarf cluster with the command: `zarf init`. |
| 138 | + |
| 139 | +Recommended Zarf components: `management`. |
| 140 | + |
| 141 | +Deploy your package into the Zarf cluster with the command: `zarf deploy`. |
| 142 | + |
| 143 | +#### (✓) - Use it |
| 144 | + |
| 145 | +Connect directly to the Zarf cluster to access your newly unpackaged applications! |
| 146 | + |
| 147 | + |
| 148 | + |
| 149 | + |
| 150 | +### Utility Mode |
| 151 | + |
| 152 | +<a href="../.images/what-is-zarf/utility-mode.png"> |
| 153 | + <img alt="how it works" src="../.images/what-is-zarf/utility-mode.png" height="283" /> |
| 154 | +</a> |
| 155 | + |
| 156 | +#### (0) - Package |
| 157 | + |
| 158 | +Move a Zarf release + desired packages to your Zarf cluster machine. |
| 159 | + |
| 160 | +#### (1) - Zarf cluster |
| 161 | + |
| 162 | +Make your Zarf cluster machine into a **single node** Zarf cluster with the command: `zarf init`. |
| 163 | + |
| 164 | +Recommended Zarf components: `management` & `gitops-services`. |
| 165 | + |
| 166 | +Deploy your package into the Zarf cluster with the command: `zarf deploy`. |
| 167 | + |
| 168 | +#### (2) - Downstream cluster |
| 169 | + |
| 170 | +Point your downstream cluster to the Zarf cluster **source code** & **container image repository** for access to base software & updates (hint: [GitOps](https://www.weave.works/technologies/gitops/)). |
| 171 | + |
| 172 | +#### (✓) - Use it |
| 173 | + |
| 174 | +Once your downstream cluster has settled accounts with the Zarf cluster, connect to the downstream cluster to access your newly unpackaged applications! |
| 175 | + |
| 176 | + |
| 177 | + |
| 178 | + |
| 179 | +## Target Use Cases |
| 180 | + |
| 181 | +Zarf's possibilities are endless—Zarf developers' time is not. Thus, scope definition is in order. |
| 182 | + |
| 183 | +Here are the things we think Zarf should get really good at, listed top-down in order of importance: |
| 184 | + |
| 185 | +- Make movement of software "across the air gap" an open source "solved problem". |
| 186 | + |
| 187 | +- Make it trivial to deploy & run Kubernetes apps "at the Edge". |
| 188 | + |
| 189 | +- Make it easy to support GitOps-based k8s cluster updates in isolated environments. |
| 190 | + |
| 191 | +- Make it possible to support GitOps-based k8s cluster updates in internet-connected-but-independent environments (think: dependency caching per availability zone, etc). |
| 192 | + |
| 193 | + |
| 194 | + |
| 195 | + |
| 196 | +## What can be packaged? |
| 197 | + |
| 198 | +To reiterate: Zarf's possibilities are endless—Zarf developers' time is not. Thus, scope definition is again in order. |
| 199 | + |
| 200 | +Given Zarf's being a "k8s cluster to serve _other_ k8s clusters", the following types of software can be rolled into a Zarf package: |
| 201 | + |
| 202 | +- container images — to serve images for the Zarf & downstream clusters to run containers from. |
| 203 | + |
| 204 | +- git repositories — to serve as the git-based "source of truth" for downstream "GitOps"ed k8s clusters to watch. |
| 205 | + |
| 206 | +- pre-compiled binaries — to provide the software necessary to start & support the Zarf cluster. |
| 207 | + |
| 208 | + |
| 209 | + |
| 210 | + |
| 211 | +## What we mean by... |
| 212 | + |
| 213 | +**declarative** — A user states (via configuration file) which resources are needed and Zarf locates & packages them. A user does not have to know _how_ to download / collect / roll & unroll dependencies for transport, they only have to know _what_ they need. |
| 214 | + |
| 215 | +**package** — A well-defined (tool-generated / versioned / compressed) collection of software intended for movement (and later use) across a network / adminstrative boundary. |
| 216 | + |
| 217 | +**remote systems** — Systems organized such that development & maintenance actions occur _primarily_ in locations physically & logically separate from where operations occur. |
| 218 | + |
| 219 | +**constrained systems** — Systems with explicit resource / adminstrative / capability limitations. |
| 220 | + |
| 221 | +**independent systems** — Systems organized such that continued operation is possible even when disconnected (temporarily or otherwise) from external systems dependencies. |
| 222 | + |
| 223 | +**air gapped systems** — Systems designed to operate while _physically disconnected_ from "unsecured" networks like the internet. More on that [here](https://en.wikipedia.org/wiki/Air_gap_(networking)). |
| 224 | + |
| 225 | + |
0 commit comments