@@ -9,7 +9,7 @@ The builder runs as a non-root user making use of user namespaces in Linux.
99* An OpenFaaS for Enterprises license or an additional entitlement for the Function Builder API is required to use this feature.
1010* Your operating system must support user namespaces, generally most modern Linux distributions do.
1111* Docker must not be installed on the host system.
12- * faasd-pro version 0.2.23 or later is required.
12+ * faasd-pro version 0.2.26 or later is required.
1313
1414## Configure a registry
1515
@@ -34,13 +34,14 @@ export PASSWORD=$(openssl rand -base64 16)
3434echo $PASSWORD > ~ /registry-password.txt
3535
3636htpasswd -Bbc ./htpasswd faasd $PASSWORD
37+ sudo mkdir -p /var/lib/faasd/registry/auth
3738sudo mv ~ /htpasswd /var/lib/faasd/registry/auth/htpasswd
3839```
3940
4041Create a configuration file for the registry:
4142
4243``` sh
43- sudo cat >> /var/lib/faasd/registry/config.yml << EOF
44+ sudo tee /var/lib/faasd/registry/config.yml > /dev/null << EOF
4445version: 0.1
4546log:
4647 accesslog:
@@ -77,6 +78,7 @@ The file will be created in the `.credentials` folder. Copy the file so that it
7778
7879``` sh
7980# Ensure faasd-provider can pull images from the faasd service".
81+ sudo mkdir -p /var/lib/faasd/.docker
8082sudo cp ./credentials/config.json /var/lib/faasd/.docker/config.json
8183# Ensure the pro-builder can mount the credentials file.
8284sudo cp ./credentials/config.json /var/lib/faasd/secrets/docker-config
@@ -89,6 +91,42 @@ To be able to access the registry from the host machine, update the `/etc/hosts`
8991echo " 127.0.0.1 registry" | sudo tee -a /etc/hosts
9092```
9193
94+ Update the faasd-provider service to add the registry as an insecure registry. This is not required if you configure TLS for the registry.
95+
96+ Edit ` /lib/systemd/system/faasd-provider.service ` and add the flag ` --insecure-registry http://registry:5000 ` to the ` ExecStart ` command:
97+
98+ ``` diff
99+ [Unit]
100+ Description=faasd-provider
101+
102+ [Service]
103+ MemoryMax=500M
104+ Environment="secret_mount_path=/var/lib/faasd/secrets"
105+ Environment="basic_auth=true"
106+ Environment="hosts_dir=/var/lib/faasd"
107+ ExecStart=/usr/local/bin/faasd provider \
108+ --insecure-registry http://registry:5000 \
109+ --dns-server 8.8.8.8 --dns-server 8.8.4.4 \
110+ --pull-policy Always \
111+ --license-file /var/lib/faasd/secrets/openfaas_license \
112+ + --insecure-registry http://registry:5000
113+ Restart=on-failure
114+ RestartSec=60s
115+ # Keep logging child process running when the main process get killed.
116+ KillMode=process
117+ WorkingDirectory=/var/lib/faasd-provider
118+
119+ [Install]
120+ WantedBy=multi-user.target
121+ ```
122+
123+ Make sure to reload the systemd daemon and restart the faasd-provider service:
124+
125+ ``` bash
126+ sudo systemctl daemon-reload
127+ sudo systemctl restart faasd-provider
128+ ```
129+
92130## Create a payload secret
93131
94132The payload secret will be used to sign the payloads sent to the Function Builder's API.
@@ -120,6 +158,7 @@ Add the following services to your `docker-compose.yaml` file:
120158 replicas : 1
121159 ports :
122160 - " 127.0.0.1:5000:5000"
161+
123162 pro-builder :
124163 depends_on : [buildkit]
125164 user : " app"
0 commit comments