Skip to content

Commit 88f9aae

Browse files
committed
Clarify examples for queue-worker chart
Signed-off-by: Alex Ellis (OpenFaaS Ltd) <[email protected]>
1 parent 30eea53 commit 88f9aae

File tree

1 file changed

+34
-5
lines changed

1 file changed

+34
-5
lines changed

chart/queue-worker/README.md

Lines changed: 34 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,16 @@
11
# JetStream for OpenFaaS queue-worker
22

3-
Deploy additional, named OpenFaaS queues.
3+
Use this chart to [deploy additional queues and queue-workers](https://docs.openfaas.com/reference/async/#dedicated-queues), for functions which need to be separated out from the default queue.
44

5-
Named queues requires OpenFaaS Enterprise. Please reach out to us if you're an existing OpenFaaS Pro customer and need this feature.
5+
> Note: This chart requires OpenFaaS for Enterprises. Please [reach out to us](https://openfaas.com/pricing) to discuss upgrading your installation.
66
7-
## Install an additional queue
7+
Reasons why you may want an additional queue-worker:
8+
9+
* You run workloads for your own product, and for tenants, and want to separate the two
10+
* You want to run some queues with different settings, such as `maxInflight` (perhaps a function has a specific amount of requests it can handle at once), `upstreamTimeout` (longer timeouts), `mode` (static/function based consumers)
11+
* Certain long-running invocations may "clog up" the queue and starve requests from other functions, so you want to run those separately
12+
13+
## Install an additional queue-worker
814

915
```bash
1016
helm upgrade slow-queue openfaas/queue-worker \
@@ -16,7 +22,30 @@ helm upgrade slow-queue openfaas/queue-worker \
1622
--set upstreamTimeout=15m
1723
```
1824

19-
When installing from the faas-netes repository on your local computer, whilst making changes or customising the chart, you can run this command from within the `faas-netes` folder.
25+
Upon start-up, the queue-worker will create a NATS JetStream stream named `slow-queue`. Depending on the queue mode either one static consumer will be created, or if the mode is set to `function`, a consumer will be created for each function that has invocations pending.
26+
27+
Remember to set the `com.openfaas.queue` annotation for your functions, so that their requests get submitted to the correct queue (NATS JetStream Stream).
28+
29+
For example:
30+
31+
```bash
32+
# Runs on the slow queue
33+
faas-cli store deploy sleep --name slow-fn --annotation com.openfaas.queue=slow-queue
34+
35+
# Runs on the default queue
36+
faas-cli store deploy env --name fast-fn
37+
```
38+
39+
## Install a development version of the chart
40+
41+
The below instructions are for development on the chart itself, or if you want to test changes to the chart's templates that have not yet been released.
42+
43+
Checkout the code, and cd to the folder:
44+
45+
```bash
46+
git clone https://github.com/openfaas/faas-netes --depth=1
47+
cd faas-netes/chart/queue-worker
48+
```
2049

2150
```bash
2251
helm upgrade slow-queue chart/queue-worker \
@@ -35,7 +64,7 @@ helm upgrade slow-queue chart/queue-worker \
3564
| `image` | The queue-worker image that should be deployed | See values.yaml |
3665
| `replicas` | Number of queue-worker replicas to create | `1` |
3766
| `queueName` | Name of the queue | `faas-request` |
38-
| `mode` | Queue operation mode: `static` or `function` | `static` |
67+
| `mode` | Queue operation mode: `static` (OpenFaaS Standard) or `function` (requires OpenFaaS for Enterprises) | `static` |
3968
| `maxInflight` | Control the concurrent invocations | `1` |
4069
| `queuePartitions` | Number of queue partitions | `1` |
4170
| `partition` | Queue partition number this queue should subscribe to | `0` |

0 commit comments

Comments
 (0)