|
2 | 2 |
|
3 | 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 | 4 |
|
| 5 | +* Download the various images for OpenFaaS Edge, its installer, and any functions you want to a machine with Internet access. |
| 6 | +* Transfer the artifacts to the air-gapped machine. |
| 7 | +* 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. |
| 8 | +* Copy across the license file and run the `faasd install` command along with any pull policy and DNS settings you require. |
| 9 | + |
| 10 | +Note: |
| 11 | + |
| 12 | +* 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. |
| 13 | +* 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. |
| 14 | + |
5 | 15 | ## Download images for offline usage
|
6 | 16 |
|
7 | 17 | 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.
|
@@ -29,6 +39,7 @@ If you do not have a `docker-compose.yaml` file, you can export the installation
|
29 | 39 | mkdir -p ./faasd-pro
|
30 | 40 | arkade oci install --path ./faasd-pro ghcr.io/openfaasltd/faasd-pro:latest
|
31 | 41 | ```
|
| 42 | + |
32 | 43 | The docker-compose.yaml file can be found at `./faasd-pro/var/lib/faasd/docker-compose.yaml`
|
33 | 44 |
|
34 | 45 | ### Download your functions
|
@@ -147,40 +158,64 @@ Download it on a machine with Internet access, transfer it to the air-gapped mac
|
147 | 158 | arkade oci install --path . ghcr.io/openfaasltd/faasd-pro-rpm:latest
|
148 | 159 | ```
|
149 | 160 |
|
| 161 | +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`. |
| 162 | + |
| 163 | +Then copy all `openfaas-edge-*.rpm` files to the air-gapped machine, and run: |
| 164 | + |
150 | 165 | Before installing OpenFaaS Edge ensure all other required packages are installed on the air-gapped system:
|
151 | 166 |
|
152 | 167 | ```sh
|
153 | 168 | sudo dnf install runc iptables-services
|
154 | 169 | ```
|
155 | 170 |
|
156 |
| -Then copy all .rpm files to the air-gapped machine, and run: |
| 171 | +Then install the OpenFaaS Edge RPM package: |
157 | 172 |
|
158 | 173 | ```bash
|
159 |
| -dnf install openfaas-edge-*.rpm |
| 174 | +sudo dnf install openfaas-edge-*.rpm |
160 | 175 | ```
|
161 | 176 |
|
| 177 | +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`. |
| 178 | + |
162 | 179 | After the installation completes add you OpenFaaS Edge license:
|
163 | 180 |
|
164 | 181 | ```sh
|
165 | 182 | sudo mkdir -p /var/lib/faasd/secrets
|
166 | 183 | sudo nano /var/lib/faasd/secrets/openfaas_license
|
167 | 184 | ```
|
168 | 185 |
|
169 |
| -Perform the final installation step: |
| 186 | +The final installation step sets up and starts the faasd and faasd-provider services. |
| 187 | + |
| 188 | +If you have a custom DNS server available, specify it using the `--dns-server` flag: |
170 | 189 |
|
171 | 190 | ```sh
|
172 |
| -sudo /usr/local/bin/faasd install |
| 191 | +--dns-server 10.0.0.1 |
173 | 192 | ```
|
174 | 193 |
|
175 |
| -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: |
| 194 | +If there is no DNS available, you can point faasd at the local host to use systemd-resolved: |
176 | 195 |
|
177 | 196 | ```sh
|
178 |
| -sudo /usr/local/bin/faasd install --dns-server 127.0.0.53 |
| 197 | +--dns-server 127.0.0.53 |
179 | 198 | ```
|
180 | 199 |
|
181 |
| -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. |
| 200 | +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. |
| 201 | + |
| 202 | +```sh |
| 203 | +--pull-policy=IfNotPresent |
| 204 | +``` |
| 205 | + |
| 206 | +Finally, construct the command to install OpenFaaS Edge: |
182 | 207 |
|
183 |
| -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`. |
| 208 | +Example with no DNS server, and images restored to the containerd library: |
184 | 209 |
|
185 |
| -Versions can be inspected using the crane tool and `crane ls ghcr.io/openfaasltd/faasd-pro-rpm`. |
| 210 | +```sh |
| 211 | +sudo /usr/local/bin/faasd install \ |
| 212 | + --dns-server 127.0.0.53 \ |
| 213 | + --pull-policy=IfNotPresent |
| 214 | +``` |
| 215 | + |
| 216 | +Example with custom DNS server, and a remote registry: |
186 | 217 |
|
| 218 | +```sh |
| 219 | +sudo /usr/local/bin/faasd install \ |
| 220 | + --dns-server 10.0.0.1 |
| 221 | +``` |
0 commit comments