Skip to content

Commit

Permalink
Add async options to Kafka connector chart
Browse files Browse the repository at this point in the history
Fixes: openfaasltd/kafka-connector#62

Signed-off-by: Alex Ellis (OpenFaaS Ltd) <alexellis2@gmail.com>
  • Loading branch information
alexellis committed Nov 17, 2020
1 parent 8e5474e commit 4e107ad
Show file tree
Hide file tree
Showing 10 changed files with 216 additions and 177 deletions.
2 changes: 1 addition & 1 deletion chart/kafka-connector/Chart.yaml
@@ -1,7 +1,7 @@
apiVersion: v1
description: Connect OpenFaaS functions to Kafka topics
name: kafka-connector
version: 0.4.0
version: 0.4.1
sources:
- https://github.com/openfaas-incubator/kafka-connector
home: https://www.openfaas.com
Expand Down
13 changes: 7 additions & 6 deletions chart/kafka-connector/README.md
Expand Up @@ -48,13 +48,14 @@ Additional kafka-connector options in `values.yaml`.

| Parameter | Description | Default |
| ------------------------ | -------------------------------------------------------------------------------------- | ------------------------------ |
| `upstream_timeout` | Maximum timeout for upstream function call, must be a Go formatted duration string. | `30s` |
| `rebuild_interval` | Interval for rebuilding function to topic map, must be a Go formatted duration string. | `3s` |
| `topics` | Topics to which the connector will bind, provide as a comma-separated list. | `faas-request` |
| `gateway_url` | The URL for the API gateway. | `http://gateway.openfaas:8080` |
| `broker_host` | location of the Kafka brokers. | `kafka` |
| `print_response` | Output the response of calling a function in the logs. | `true` |
| `print_response_body` | Output to the logs the response body when calling a function. | `false` |
| `brokerHost` | location of the Kafka brokers. | `kafka` |
| `asyncInvocation` | For long running or slow functions, offload to asychronous function invocations and carry on processing the stream |
| `upstreamTimeout` | Maximum timeout for upstream function call, must be a Go formatted duration string. | `30s` |
| `rebuildInterval` | Interval for rebuilding function to topic map, must be a Go formatted duration string. | `3s` |
| `gatewayURL` | The URL for the API gateway. | `http://gateway.openfaas:8080` |
| `printResponse` | Output the response of calling a function in the logs. | `true` |
| `printResponseBody` | Output to the logs the response body when calling a function. | `false` |
| `fullnameOverride` | Override the name value used for the Connector Deployment object. | `` |

Specify each parameter using the `--set key=value[,key=value]` argument to `helm install`.
Expand Down
20 changes: 11 additions & 9 deletions chart/kafka-connector/templates/deployment.yml
Expand Up @@ -44,28 +44,30 @@ spec:
image: {{ .Values.image }}
env:
- name: gateway_url
value: {{ .Values.gateway_url | quote }}
value: {{ .Values.gatewayURL | quote }}
- name: topics
value: {{ .Values.topics | quote }}
- name: print_response
value: {{ .Values.print_response | quote }}
value: {{ .Values.printResponse | quote }}
- name: print_response_body
value: {{ .Values.print_response_body | quote }}
{{- if .Values.basic_auth }}
value: {{ .Values.printResponseBody | quote }}
- name: asynchronous_invocation
value: {{ .Values.asyncInvocation | quote }}
{{- if .Values.basicAuth }}
- name: basic_auth
value: "true"
- name: secret_mount_path
value: "/var/secrets"
{{- end }}
- name: broker_host
value: {{ .Values.broker_host | quote }}
{{- if .Values.upstream_timeout }}
value: {{ .Values.brokerHost | quote }}
{{- if .Values.upstreamTimeout }}
- name: upstream_timeout
value: {{ .Values.upstream_timeout | quote }}
value: {{ .Values.upstreamTimeout | quote }}
{{- end }}
{{- if .Values.rebuild_interval }}
{{- if .Values.rebuildInterval }}
- name: rebuild_interval
value: {{ .Values.rebuild_interval | quote }}
value: {{ .Values.rebuildInterval | quote }}
{{- end }}
{{- if .Values.basic_auth }}
volumeMounts:
Expand Down
25 changes: 20 additions & 5 deletions chart/kafka-connector/values.yaml
@@ -1,11 +1,26 @@
image: openfaas/kafka-connector:0.4.0
replicas: 1
gateway_url: http://gateway.openfaas:8080

# Max timeout for a function
upstreamTimeout: 2m

# Use with slow consumers or long running functions
asyncInvocation: false

# Alter to the topics required
topics: faas-request
print_response: true
print_response_body: false
broker_host: kafka:9092
basic_auth: true

# Your Kafka broker
brokerHost: kafka:9092

printResponse: true
printResponseBody: false

# Internal gateway URL
gatewayURL: http://gateway.openfaas:8080

# Basic auth for the gateway
basicAuth: true

nodeSelector: {}

Expand Down
Binary file modified docs/cron-connector-0.3.1.tgz
Binary file not shown.

0 comments on commit 4e107ad

Please sign in to comment.