|
| 1 | +# Air-gapped OpenFaaS Edge |
| 2 | + |
| 3 | +OpenFaaS Edge can be installed within an air-gapped environment using images copied from a machine with Internet access, to one without it. |
| 4 | + |
| 5 | +## Download images for offline usage |
| 6 | + |
| 7 | +You can download, transfer and restore the images whichever way you prefer, however we maintain a dedicated, supported tool to do this for you called airfaas. |
| 8 | + |
| 9 | +### Download the OpenFaaS Edge images for offline access |
| 10 | + |
| 11 | +On a PC with Internet access, run the following command to download the images: |
| 12 | + |
| 13 | +```bash |
| 14 | +faas-cli plugin get airfaas |
| 15 | +``` |
| 16 | + |
| 17 | +Now, download the images for OpenFaaS Edge from your docker-compose.yaml file: |
| 18 | + |
| 19 | +```bash |
| 20 | +faas-cli airfaas download images \ |
| 21 | + --yaml ./docker-compose.yaml \ |
| 22 | + --path ./images \ |
| 23 | + openfaas-edge |
| 24 | +``` |
| 25 | + |
| 26 | +If you do not have a docker-compose.yaml file, you can install OpenFaaS Edge on a Linux host and then extract it from `/var/lib/faasd/docker-compose.yaml`. |
| 27 | + |
| 28 | +### Download your functions |
| 29 | + |
| 30 | +You can also download your functions using the same method. |
| 31 | + |
| 32 | +```bash |
| 33 | +faas-cli airfaas download images \ |
| 34 | + --yaml ./stack.yaml \ |
| 35 | + --path ./images \ |
| 36 | + functions |
| 37 | +``` |
| 38 | + |
| 39 | +## Transfer the images |
| 40 | + |
| 41 | +Transfer the `./images` directory to the air-gapped machine using your preferred method. This could be a USB drive, SCP, rsync, or any other method you prefer. |
| 42 | + |
| 43 | +## Restore the images |
| 44 | + |
| 45 | +When running OpenFaaS Edge in an air-gap, you can restore the images to either a local registry or the containerd library. |
| 46 | + |
| 47 | +### Restore images to the containerd library |
| 48 | + |
| 49 | +The easiest way to test an air-gapped installation, is to bypass the need for a local registry, and to restore the images directly to the containerd library. |
| 50 | + |
| 51 | +Restore the OpenFaaS Edge images: |
| 52 | + |
| 53 | +```bash |
| 54 | +faas-cli airfaas restore \ |
| 55 | + --containerd \ |
| 56 | + --path ./images/openfaas-edge/images.json \ |
| 57 | + --namespace openfaas |
| 58 | +``` |
| 59 | + |
| 60 | +If you need to restore any of your own functions, make sure you pass the `--namespace` flag, i.e. |
| 61 | + |
| 62 | +```bash |
| 63 | +faas-cli airfaas restore \ |
| 64 | + --containerd \ |
| 65 | + --path ./images/functions/images.json \ |
| 66 | + --namespace openfaas-fn |
| 67 | +``` |
| 68 | + |
| 69 | +### Restore images to a local registry |
| 70 | + |
| 71 | +You can restore the images to a local registry using the following command: |
| 72 | + |
| 73 | +```bash |
| 74 | +faas-cli airfaas restore \ |
| 75 | + --path ./images/openfaas-edge/images.json |
| 76 | +``` |
| 77 | + |
| 78 | +To update the original registry references i.e. `ghcr.io/openfaasltd` to your own i.e. `localhost:5000/openfaasltd`, you can use the `--prefix` flag. |
| 79 | + |
| 80 | +When using a self-signed certificate, use the `--insecure-registry` flag to skip TLS verification. |
| 81 | + |
| 82 | +Further examples are available via the `--help` flag. |
| 83 | + |
| 84 | +## Perform the installation |
| 85 | + |
| 86 | +### Debian-based systems |
| 87 | + |
| 88 | +If you're using an Operating System such as Ubuntu, you can export the installation bundle and copy it to the air-gapped machine, then perform the installation as normal. |
| 89 | + |
| 90 | +Download the installation package: |
| 91 | + |
| 92 | +```bash |
| 93 | +mkdir -p ./faasd-pro |
| 94 | +arkade oci install --path ./faasd-pro ghcr.io/openfaasltd/faasd-pro:latest |
| 95 | +``` |
| 96 | + |
| 97 | +Then copy the `faasd-pro` directory to the air-gapped machine. |
| 98 | + |
| 99 | +Finally, download the installation script, copy it over: |
| 100 | + |
| 101 | +```bash |
| 102 | +curl -sLSf \ |
| 103 | + https://raw.githubusercontent.com/openfaas/faasd/refs/heads/master/hack/install-edge.sh \ |
| 104 | + -o install-edge.sh |
| 105 | +``` |
| 106 | + |
| 107 | +Then run the install-edge.sh script on the remote server: |
| 108 | + |
| 109 | +```bash |
| 110 | +chmod +x install-edge.sh |
| 111 | +sudo -E ./install-edge.sh |
| 112 | +``` |
| 113 | + |
| 114 | +### RHEL-like systems |
| 115 | + |
| 116 | +For Operating Systems such as Oracle Linux, Alma Linux, and Rocky Linux you can use our official rpm package to install OpenFaaS Edge. |
| 117 | + |
| 118 | +Download it on a machine with Internet access, transfer it to the air-gapped machine, and install it using: |
| 119 | + |
| 120 | +```bash |
| 121 | +arkade oci install --path . ghcr.io/openfaasltd/faasd-pro-rpm:latest |
| 122 | +``` |
| 123 | + |
| 124 | +Then copy all .rpm files to the air-gapped machine, and run: |
| 125 | + |
| 126 | +```bash |
| 127 | +dnf install openfaas-edge-*.rpm |
| 128 | +``` |
| 129 | + |
| 130 | +Follow any additional prompts and instructions. |
| 131 | + |
| 132 | +It is possible to specify a different version of the package by changing the `latest` tag to a specific version, e.g. `v0.2.16`. |
| 133 | + |
| 134 | +Versions can be inspected using the crane tool and `crane ls ghcr.io/openfaasltd/faasd-pro-rpm`. |
| 135 | + |
0 commit comments