Skip to content

Commit ba971cb

Browse files
committed
Strongly advise use of helm for installation
Signed-off-by: Alex Ellis (VMware) <alexellis2@gmail.com>
1 parent e4374d0 commit ba971cb

1 file changed

Lines changed: 24 additions & 23 deletions

File tree

docs/deployment/kubernetes.md

Lines changed: 24 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,9 @@
22

33
This guide is for deployment to a vanilla Kubernetes 1.8 or 1.9 cluster running on Linux hosts. It is not a hand-book, please see the set of guides and blogs posts available at [openfaas/guide](https://github.com/openfaas/faas/tree/master/guide).
44

5-
## Kubernetes
6-
75
OpenFaaS is Kubernetes-native and uses *Deployments*, *Services* and *Secrets*. For more detail check out the ["faas-netes" repository](https://github.com/openfaas/faas-netes).
86

9-
### Build a cluster
7+
## Build a cluster
108

119
You can start evaluating FaaS and building functions on your laptop or on a VM (cloud or on-prem).
1210

@@ -29,9 +27,13 @@ We have a special guide for minikube here:
2927

3028
### Pick helm or YAML files for deployment
3129

32-
If you'd like to use helm follow the instructions in 2.0a and then come back here, otherwise follow 2.0b to use plain `kubectl`.
30+
It is recommended to use `helm` to install OpenFaaS so that you can configure your installation to suit your needs. This configuration is considered to be production-ready.
31+
32+
If you have issues using `helm` in a locked-down environment then you can still use the `helm template` command to generate a custom set of YAML to apply using `kubectl`.
3333

34-
### Deploy with Helm
34+
Plain YAML files are also provided for x86_64 and armhf, but since they cannot be customized easily it is recommended that you only use these for local development.
35+
36+
#### Deploy with Helm
3537

3638
A Helm chart is provided in the `faas-netes` repository. Follow the link below then come back to this guide.
3739

@@ -41,7 +43,7 @@ To enable SSL while using Helm, try one of the following references:
4143

4244
- [Using nginx-ingress and cert-manager](/reference/ssl/kubernetes-with-cert-manager.md)
4345

44-
### Deploy OpenFaaS
46+
#### Deploy OpenFaaS
4547

4648
This step assumes you are running `kubectl` on a master host.
4749

@@ -74,15 +76,15 @@ This step assumes you are running `kubectl` on a master host.
7476
!!! note
7577
For deploying on a cloud that supports Kubernetes *LoadBalancers* you may also want to apply the configuration in: `cloud/lb.yml`.
7678

77-
### Use OpenFaaS
79+
#### Use OpenFaaS
7880

7981
After deploying OpenFaaS you can start using one of the guides or blog posts to create Serverless functions or test [community functions](https://github.com/openfaas/faas/blob/master/community.md).
8082

8183
![](https://camo.githubusercontent.com/72f71cb0b0f6cae1c84f5a40ad57b7a9e389d0b7/68747470733a2f2f7062732e7477696d672e636f6d2f6d656469612f44466b5575483158734141744e4a362e6a70673a6d656469756d)
8284

8385
You can also watch a complete walk-through of OpenFaaS on Kubernetes which demonstrates auto-scaling in action and how to use the Prometheus UI. [Video walk-through](https://www.youtube.com/watch?v=0DbrLsUvaso).
8486

85-
## Deploy a function
87+
### Deploy a function
8688

8789
For simplicity the default configuration uses NodePorts rather than an IngressController (which is more complicated to setup).
8890

@@ -98,7 +100,7 @@ For simplicity the default configuration uses NodePorts rather than an IngressCo
98100
99101
There are currently no sample functions built into this stack, but we can deploy them quickly via the UI or FaaS-CLI.
100102
101-
### Use the CLI
103+
#### Use the CLI
102104
103105
* Install the CLI
104106
@@ -137,7 +139,7 @@ There are currently no sample functions built into this stack, but we can deploy
137139
faas-cli deploy -f stack.yml --gateway http://127.0.0.1:31112
138140
```
139141
140-
#### List the functions
142+
##### List the functions
141143
142144
```bash
143145
$ faas-cli list -f stack.yml
@@ -164,7 +166,7 @@ c6ee9e33cf5c6715a1d148fd73f7318884b41adcb916021e2bc0e800a5c5dd97f5142178f6ae88c8
164166
165167
[Your first serverless Python function with OpenFaaS](https://blog.alexellis.io/first-faas-python-function/)
166168
167-
### Use the UI
169+
#### Use the UI
168170
169171
The UI is exposed on NodePort 31112.
170172
@@ -188,27 +190,27 @@ $ echo -n "" | faas-cli invoke --gateway http://kubernetes-ip:31112 nodeinfo
188190
$ echo -n "verbose" | faas-cli invoke --gateway http://kubernetes-ip:31112 nodeinfo
189191
```
190192
191-
## Start the hands-on labs
193+
### Start the hands-on labs
192194
193195
Learn how to build Serverless functions with OpenFaaS and Python in our half-day workshop. You can follow along online at your own pace.
194196
195197
* [OpenFaaS workshop](/tutorials/workshop/)
196-
## Troubleshooting
198+
### Troubleshooting
197199
198200
If you are running into any issues please check out the troubleshooting guide and search the documentation / past issues before raising an issue.
199201
200202
* [Troubleshooting guide](https://github.com/openfaas/faas/blob/master/guide/troubleshooting.md)
201203
202-
## Advanced
204+
### Advanced
203205
204206
This section covers additional advanced topics beyond the initial deployment.
205207
206-
### Use a private registry with Kubernetes
208+
#### Use a private registry with Kubernetes
207209
208210
If you are using a hosted private Docker registry ([Docker Hub](https://hub.docker.com/), or other),
209211
in order to check how to configure it, please visit the Kubernetes [documentation](https://kubernetes.io/docs/concepts/containers/images/#using-a-private-registry).
210212
211-
#### Deploy a function from a private Docker image
213+
##### Deploy a function from a private Docker image
212214
213215
With the following commands you can deploy a function from a private Docker image, tag and push it to your docker registry account:
214216
@@ -232,7 +234,7 @@ In your favorite editor, open stack.yaml and add
232234
```yml
233235
provider:
234236
name: faas
235-
gateway: http://localhost:8080
237+
gateway: http://127.0.0.1:8080
236238
237239
functions:
238240
protectedapi:
@@ -241,7 +243,7 @@ functions:
241243
image: username/private-alpine:latest
242244
```
243245
244-
#### Create an image pull secret
246+
##### Create an image pull secret
245247
246248
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.
247249
@@ -276,7 +278,7 @@ This is a `stack.yml` example with the secret added in it:
276278
```yml
277279
provider:
278280
name: faas
279-
gateway: http://localhost:8080
281+
gateway: http://127.0.0.1:8080
280282
281283
functions:
282284
protectedapi:
@@ -289,7 +291,7 @@ This is a `stack.yml` example with the secret added in it:
289291
290292
You can deploy your function using `faas-cli deploy`. If you inspect the Kubernetes pods, you will see that it can pull the docker image.
291293
292-
#### Link the image pull secret to a namespace service account
294+
##### Link the image pull secret to a namespace service account
293295
294296
Instead of always editing the function .yml you can link your private Docker repository secret to the Kubernetes namespace service account manifest. This will auto add the `imagePullSecret` property to any deployment/pod manifest refrencing an image in that particular private repo.
295297
@@ -317,7 +319,7 @@ imagePullSecrets:
317319
Save your changes.
318320
OpenFaaS will now deploy functions with images in private repositories without having to specify the secret in the deployment manifests.
319321
320-
### Set a custom ImagePullPolicy
322+
#### Set a custom ImagePullPolicy
321323
322324
Kubernetes allows you to control the conditions for when the Docker images for your functions are pulled onto a node. This is configured through an [imagePullPolicy](https://kubernetes.io/docs/concepts/containers/images/#updating-images).
323325
@@ -341,11 +343,10 @@ If you're using the plain YAML files then edit `gateway-dep.yml` and set the fol
341343
value: "IfNotPresent"
342344
```
343345
344-
#### Notes on picking an "imagePullPolicy"
346+
##### Notes on picking an "imagePullPolicy"
345347
346348
As mentioned above, the default value is `Always`. Every time a function is deployed or is scaled up, Kubernetes will pull a potentially updated copy of the image from the registry. If you are using static image tags like `latest`, this is necessary.
347349
348350
When set to `IfNotPresent`, function deployments may not be updated when using static image tags like `latest`. `IfNotPresent` is particularly useful when developing locally with minikube. In this case, you can set your local environment to use [minikube's docker](https://github.com/kubernetes/minikube/blob/master/docs/reusing_the_docker_daemon.md) so `faas-cli build` builds directly into minikube's image store. `faas-cli push` is unnecessary in this workflow - use faas-cli build then faas-cli deploy.
349351
350352
When set to `Never`, only local (or pulled) images will work. This is useful if you want to tightly control which images are available and run in your Kubernetes cluster.
351-

0 commit comments

Comments
 (0)