Skip to content

Commit

Permalink
Update queue-worker, remove NATS core monitoring
Browse files Browse the repository at this point in the history
NATS core monitoring is no longer needed due to the metrics
emitted by the queue-worker itself in JetStream mode

The queue-worker will now retry 503s if they come from the
faas-provider HTTP proxy.

The port 8082 which servers metrics from the gateway is now
set as an explicit port in the Pod spec for visibility.

Signed-off-by: Alex Ellis (OpenFaaS Ltd) <[email protected]>
  • Loading branch information
alexellis committed Nov 2, 2023
1 parent 250abc0 commit e5bbe43
Show file tree
Hide file tree
Showing 28 changed files with 479 additions and 491 deletions.
2 changes: 1 addition & 1 deletion chart/openfaas/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v2
type: application
description: OpenFaaS - Serverless Functions Made Simple
name: openfaas
version: 14.1.16
version: 14.1.17
sources:
- https://github.com/openfaas/faas
- https://github.com/openfaas/faas-netes
Expand Down
3 changes: 0 additions & 3 deletions chart/openfaas/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -535,14 +535,11 @@ yaml) |
| `jetstreamQueueWorker.logs.debug` | Log debug messages | `false` |
| `jetstreamQueueWorker.logs.format` | Set the log format, supports `console` or `json` | `console` |
| `nats.channel` | The name of the NATS Streaming channel or NATS JetStream stream to use for asynchronous function invocations | `faas-request` |
| `nats.enableMonitoring` | Enable the NATS monitoring endpoints on port `8222` for NATS Streaming deployments managed by this chart | `false` |
| `nats.external.clusterName` | The name of the externally-managed NATS Streaming server | `""` |
| `nats.external.enabled` | Whether to use an externally-managed NATS Streaming server | `false` |
| `nats.external.host` | The host at which the externally-managed NATS Streaming server can be reached | `""` |
| `nats.external.port` | The port at which the externally-managed NATS Streaming server can be reached | `""` |
| `nats.image` | Container image used for NATS | See [values.yaml](./values.yaml) |
| `nats.metrics.enabled` | Export Prometheus metrics for NATS, no multi-arch support | `false` |
| `nats.metrics.image` | Container image used for the NATS Prometheus exporter | See [values.yaml](./values.yaml) |
| `nats.resources` | Resource limits and requests for the nats pods | See [values.yaml](./values.yaml) |
| `nats.streamReplication` | JetStream stream replication factor. For production a value of at least 3 is recommended. | `1` |
| `queueWorker.ackWait` | Max duration of any async task/request | `60s` |
Expand Down
9 changes: 7 additions & 2 deletions chart/openfaas/templates/gateway-dep.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,9 @@ spec:
- name: http
containerPort: 8080
protocol: TCP
- name: gw-metrics
containerPort: 8082
protocol: TCP
{{- if .Values.operator.create }}
- name: operator
resources:
Expand Down Expand Up @@ -293,7 +296,8 @@ spec:
value: "/var/secrets"
{{- end }}
ports:
- containerPort: 8081
- name: provider
containerPort: 8081
protocol: TCP
volumeMounts:
{{- if .Values.iam.enabled }}
Expand Down Expand Up @@ -401,7 +405,8 @@ spec:
- mountPath: /tmp
name: faas-netes-temp-volume
ports:
- containerPort: 8081
- name: provider
containerPort: 8081
protocol: TCP
{{- end }}
{{- with .Values.nodeSelector }}
Expand Down
4 changes: 1 addition & 3 deletions chart/openfaas/templates/gateway-provider-svc.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# This should usually be disabled and is only required for testing

{{- if .Values.openfaasPro }}
apiVersion: v1
kind: Service
Expand All @@ -18,7 +16,7 @@ metadata:
spec:
type: ClusterIP
ports:
- name: http
- name: provider
port: 8081
targetPort: 8081
protocol: TCP
Expand Down
35 changes: 1 addition & 34 deletions chart/openfaas/templates/nats-dep.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,7 @@ spec:
template:
metadata:
annotations:
prometheus.io/scrape: {{ .Values.nats.metrics.enabled | quote }}
{{- if .Values.nats.metrics.enabled }}
prometheus.io/port: "7777"
{{- end }}
prometheus.io/scrape: false
labels:
app: nats
spec:
Expand All @@ -38,10 +35,6 @@ spec:
ports:
- containerPort: 4222
protocol: TCP
{{- if .Values.nats.enableMonitoring }}
- containerPort: 8222
protocol: TCP
{{- end }}
{{- if not (eq .Values.queueMode "jetstream") }}
command: ["/nats-streaming-server"]
{{- end }}
Expand All @@ -54,32 +47,6 @@ spec:
- --cluster_id
- faas-cluster
{{- end }}
{{- if or .Values.nats.enableMonitoring .Values.nats.metrics.enabled }}
- -m
- "8222"
{{- end }}
{{- if .Values.nats.metrics.enabled }}
- name: metrics
image: {{ .Values.nats.metrics.image }}
imagePullPolicy: {{ .Values.openfaasImagePullPolicy }}
ports:
- containerPort: 7777
protocol: TCP
args:
- -port
- "7777"
- -connz
- -routez
- -subz
- -varz
{{- if eq .Values.queueMode "jetstream" }}
- -jsz=all
{{- else }}
- -channelz
- -serverz
{{- end }}
- http://localhost:8222
{{- end }}
{{- with .Values.nodeSelector }}
nodeSelector:
{{ toYaml . | indent 8 }}
Expand Down
10 changes: 0 additions & 10 deletions chart/openfaas/templates/nats-svc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,6 @@ spec:
- port: 4222
protocol: TCP
name: tcp
{{- if .Values.nats.enableMonitoring }}
- port: 8222
protocol: TCP
name: monitoring
{{- end }}
{{- if .Values.nats.metrics.enabled }}
- port: 7777
protocol: TCP
name: metrics
{{- end }}
selector:
app: nats
{{- end }}
6 changes: 0 additions & 6 deletions chart/openfaas/values-arm64.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,3 @@ prometheus:
resources:
requests:
memory: "100Mi"

nats:
enableMonitoring: false
metrics:
# Should stay off by default because the exporter is not multi-arch (yet)
enabled: false
5 changes: 0 additions & 5 deletions chart/openfaas/values-armhf.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,3 @@ prometheus:
requests:
memory: "100Mi"

nats:
enableMonitoring: false
metrics:
# Should stay off by default because the exporter is not multi-arch (yet)
enabled: false
7 changes: 1 addition & 6 deletions chart/openfaas/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ faasnetes:
#
# Enable automatically when nats.queueMode is set to "jetstream"
jetstreamQueueWorker:
image: ghcr.io/openfaasltd/jetstream-queue-worker:0.3.14
image: ghcr.io/openfaasltd/jetstream-queue-worker:0.3.16
durableName: "faas-workers"
# Configure the max waiting pulls for the queue-worker JetStream consumer.
# The value should be at least max_inflight * replicas.
Expand Down Expand Up @@ -302,11 +302,6 @@ nats:
port: ""
# The version of NATS Core used with OpenFaaS Pro and JetStream
image: nats:2.10.4
enableMonitoring: false
metrics:
# Should stay off by default because the exporter is not multi-arch (yet)
enabled: false
image: natsio/prometheus-nats-exporter:0.13.0
resources:
requests:
memory: "120Mi"
Expand Down
2 changes: 1 addition & 1 deletion chart/queue-worker/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v2
name: queue-worker
description: JetStream for OpenFaaS queue-worker
type: application
version: 0.1.7
version: 0.1.8
keywords:
- openfaas
- jetstream
Expand Down
2 changes: 1 addition & 1 deletion chart/queue-worker/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# You will need to create a license named "openfaas-license" - see the
# chart README for detailed instructions.

image: ghcr.io/openfaasltd/jetstream-queue-worker:0.3.14
image: ghcr.io/openfaasltd/jetstream-queue-worker:0.3.16

replicas: 1

Expand Down
Binary file modified docs/cron-connector-0.6.6.tgz
Binary file not shown.
Binary file modified docs/federated-gateway-0.0.3.tgz
Binary file not shown.
Loading

0 comments on commit e5bbe43

Please sign in to comment.