You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add docs for how to use a private registry with Kubernetes
This adds the following documentation: how to configure a private
registry (link to Kubernetes documentation), how to create an
image pull secret and add the secret to an yaml file, how to pull
a function from a private Docker image and push it to a Docker
registry.
Signed-off-by: Ivana Yovcheva (VMware) <[email protected]>
If you are using a hosted private Docker registry ([Docker Hub](https://hub.docker.com/), or other),
191
+
in order to check how to configure it, please visit the Kubernetes [documentation](https://kubernetes.io/docs/concepts/containers/images/#using-a-private-registry).
192
+
193
+
#### Deploy a function from a private Docker image
194
+
195
+
With the following commands you can deploy a function from a private Docker image, tag and push it to your docker registry account:
196
+
197
+
```bash
198
+
$ docker pull functions/alpine:latest
199
+
$ docker tag functions/alpine:latest $DOCKER_USERNAME/private-alpine:latest
Log into the [Hub](https://hub.docker.com/) and make your image `private-alpine` private.
204
+
205
+
Then create your openfaas project:
206
+
207
+
```bash
208
+
$ mkdir privatefuncs && cd privatefuncs
209
+
$ touch stack.yaml
210
+
```
211
+
212
+
In your favorite editor, open stack.yaml and add
213
+
214
+
```yml
215
+
provider:
216
+
name: faas
217
+
gateway: http://localhost:8080
218
+
219
+
functions:
220
+
protectedapi:
221
+
lang: Dockerfile
222
+
skip_build: true
223
+
image: username/private-alpine:latest
224
+
```
225
+
226
+
#### Create an image pull secret
227
+
228
+
If you try to deploy using `faas-cli deploy` it will fail because Kubernetes can not pull the image. You can verify this in the Kubernetes dashboard or via the CLI using the `kubectl describe` command.
229
+
230
+
To deploy the function, you need to create an [Image Pull Secret](https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/)
231
+
232
+
You should set the following environmental variables:
0 commit comments