Skip to content

Commit 0c1a48d

Browse files
weltekialexellis
authored andcommitted
Update OpenFaaS Pro docs for mirroring images
Update the section on mirroring images for OpenFaaS Pro into your own regsitry to reflect the latest changes to the airfaas cli. Signed-off-by: Han Verstraete (OpenFaaS Ltd) <han@openfaas.com>
1 parent cf6d5ac commit 0c1a48d

1 file changed

Lines changed: 25 additions & 22 deletions

File tree

docs/openfaas-pro/airgap.md

Lines changed: 25 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
## Air Gap with Kubernetes
1+
# Air Gap with Kubernetes
22

33
OpenFaaS Standard and OpenFaaS for Enterprises are licensed for use within an airgap when purchased on an annual basis via invoice.
44

55
You can use your own choice of tooling to mirror images and bundle the Helm chart(s) required for your installations, or you can use our own purpose-built airfaas tool.
66

7-
### Mirror OpenFaaS images into your own registry
7+
## Mirror OpenFaaS images into your own registry
88

99
If your organisation has a policy of mirroring all consumed images from vendors into a private registry, then `airfaas mirror` can help you with this, even if you don't install OpenFaaS into an airgapped environment.
1010

@@ -15,38 +15,32 @@ faas-cli plugin get airfaas
1515
Mirror all images for the given chart/index to a custom registry:
1616

1717
```bash
18-
faas-cli airfaas download images \
19-
openfaas/openfaas \
20-
--registry-prefix ttl.sh
18+
faas-cli airfaas mirror \
19+
openfaas/openfaas \
20+
--registry ttl.sh
2121
```
2222

2323
Mirror the Kafka-connector's images:
2424

2525
```bash
26-
faas-cli airfaas download images \
27-
openfaas/kafka-connector \
28-
--registry-prefix ttl.sh
26+
faas-cli airfaas mirror \
27+
openfaas/kafka-connector \
28+
--registry ttl.sh
2929
```
3030

31+
The `-f/--file` flag can be used to write a `values.yaml` file with the mirrored image names, which can be used as an overlay to your existing `values.yaml` file when deploying OpenFaaS.
3132
The `--url` flag can be used to specify a different Helm chart repository. The only requirement is that images are stored in the same format as OpenFaaS: i.e. `image:` or `componentName.image:`.
3233

3334
Note: if you receive an access denied error from ghcr.io, it's most likely because you have an old, expired access token in your local Docker config or keychain. Run `docker logout ghcr.io` to clear the token and try again.
3435

35-
## Consume the mirrored images from your own registry
36-
37-
After the mirroring is complete, you'll receive output in the format of a values.yaml file, which you can add to your `helm upgrade --install` command.
38-
39-
```bash
40-
$ faas-cli airfaas mirror openfaas/openfaas --to https://aws_account_id.dkr.ecr.us-west-2.amazonaws.com/openfaas
41-
Mirrored 18 images in 3m7.242s
42-
```
36+
### Consume the mirrored images from your own registry
4337

4438
There are two options for consuming the mirrored images:
4539

4640
1. Use the `registryPrefix` setting to add a prefixed string i.e. your registry to the image name across all images i.e. `registryPrefix: aws_account_id.dkr.ecr.us-west-2.amazonaws.com/openfaas`
47-
2. Use the generated text produced by `airfaas` as an overlay to your existing `values.yaml` file.
41+
2. Use the generated generated values.yaml file produced by running `arifaas mirror` with the `--file` flag as an overlay to your existing `values.yaml` file.
4842

49-
### Option 1 - Use the `registryPrefix` setting
43+
#### Option 1 - Use the `registryPrefix` setting
5044

5145
```yaml
5246
registryPrefix: aws_account_id.dkr.ecr.us-west-2.amazonaws.com/openfaas
@@ -61,9 +55,18 @@ imagePullSecrets:
6155

6256
For certain registries such as AWS ECR, it's possible to use the ambient AWS IAM credentials to authenticate the registry without overriding the default `imagePullSecrets` setting.
6357

64-
### Option 2 - Use the generated text produced by `airfaas` as an overlay to your existing `values.yaml` file.
58+
#### Option 2 - Use the generated values file produced by `airfaas` as an overlay to your existing `values.yaml` file.
59+
60+
Run `faas-cli airfaas mirror` with the `--file` flag to generate a values.yaml file with the mirrored image names e.g:
61+
62+
```bash
63+
faas-cli airfaas mirror \
64+
openfaas/openfaas \
65+
--registry aws_account_id.dkr.ecr.us-west-2.amazonaws.com/openfaas \
66+
--file values-mirror.yaml
67+
```
6568

66-
Then copy the below to i.e. `values-mirror.yaml`:
69+
The resuling file should looke like this, with all images updated to point to the mirrored registry:
6770

6871
```yaml
6972
gatewayPro:
@@ -85,7 +88,7 @@ helm upgrade --install openfaas \
8588
-f values-mirror.yaml
8689
```
8790

88-
### Perform an offline installation
91+
## Perform an offline installation
8992

9093
Airfaas can perform an offline installation of OpenFaaS into an airgapped environment. It will bundle the Helm chart(s) and images required for the installation, then restore the images into an offline registry, and install OpenFaaS using the Helm chart(s) from the local filesystem.
9194

@@ -95,4 +98,4 @@ Airfaas can perform an offline installation of OpenFaaS into an airgapped enviro
9598
![Conceptual upload process](https://www.openfaas.com/images/2024-04-airgap/restore.png)
9699
> The upload / installation process
97100

98-
Follow the instructions in: [Deploy airgapped Serverless Functions with OpenFaaS](https://www.openfaas.com/blog/airgap-serverless-functions/)
101+
Follow the instructions in: [Deploy airgapped Serverless Functions with OpenFaaS](https://www.openfaas.com/blog/airgap-serverless-functions/)

0 commit comments

Comments
 (0)