OpenFaaS Edge can be installed within an air-gapped environment using images copied from a machine with Internet access, to one without it.
Download the various images for OpenFaaS Edge, its installer, and any functions you want to a machine with Internet access.
Transfer the artifacts to the air-gapped machine.
Decide whether to restore the images to a self-hosted registry on the machine, to the containerd library, or a remote registry available to the air gap.
Copy across the license file and run the faasd install command along with any pull policy and DNS settings you require.
Note:
If your registry requires authentication, you'll have to create a config file for the credentials. Follow the chapter entitled "Private registries" in Serverless For Everyone Else.
It is possible to run a self-hosted registry with a self-signed certificate directly on the host with systemd, follow the chapter entitled "Adding a self-hosted container registry" in Serverless For Everyone Else.
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.
Download the OpenFaaS Edge images for offline access¶
On a PC with Internet access, run the following command to download the images:
faas-cliplugingetairfaas
Now, download the images for OpenFaaS Edge from your docker-compose.yaml file:
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.
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.
OpenFaaS Edge binaries and dependencies need to be installed before you can run the restore command. Follow the air-gapped installation instructions and restore the images right before running faasd install.
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.
Ensure required packages are installed on the air-gapped system:
By default OpenFaaS uses Google's public DNS servers you need to specify custom DNS servers during the installation phase by setting the --dns-server flag:
sudofaasdinstall--dns-server127.0.0.53
Make sure to also add --pull-policy=IfNotPresent when images were restored directly to the containerd library. This is not required when using a local image registry.
If you wish to obtain a specific version of the RPM, update the tag from :latest to i.e. :0.2.18. Browse available versions via crane ls ghcr.io/openfaasltd/faasd-pro-rpm.
Then copy all openfaas-edge-*.rpm files to the air-gapped machine.
Before installing OpenFaaS Edge ensure all other required packages are installed on the air-gapped system:
sudodnfinstallrunciptables-services
If you have no way to source the required packages in the offline environment, you can download them on the online machine with:
Note: If your online machine is not running a RHEL-like OS, you could use Docker and mount a folder in for persistence.
Then copy the folder to the remote machine, and install those packages first with:
sudodnfinstall--disablerepo="*"./rpm/*.rpm
Then install the OpenFaaS Edge RPM package:
sudodnfinstallopenfaas-edge-*.rpm
The command will let you know whether any other required system package are missing such as selinux-policy, libselinux-utils, protobuf-c, and container-selinux.
After the installation completes add you OpenFaaS Edge license:
The final installation step sets up and starts the faasd and faasd-provider services.
If you have a custom DNS server available, specify it using the --dns-server flag:
--dns-server10.0.0.1
If there is no DNS available, you can point faasd at the local host to use systemd-resolved:
--dns-server127.0.0.53
If your images are restored to the containerd library, you will have to use the --pull-policy=IfNotPresent flag to prevent faasd from trying to pull the images from the Internet.
--pull-policy=IfNotPresent
Finally, construct the command to install OpenFaaS Edge:
Example with no DNS server, and images restored to the containerd library: