Skip to content

Commit

Permalink
Add topologySpreadConstraints for gateway
Browse files Browse the repository at this point in the history
The default topologySpreadConstraints tries to schedule each
of the gateway replicas onto different nodes in the cluster.

This can be customised as/if required.

Signed-off-by: Alex Ellis (OpenFaaS Ltd) <[email protected]>
  • Loading branch information
alexellis committed Aug 23, 2024
1 parent 8d711d2 commit eff7a82
Show file tree
Hide file tree
Showing 15 changed files with 568 additions and 531 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.2.71
version: 14.2.72
sources:
- https://github.com/openfaas/faas
- https://github.com/openfaas/faas-netes
Expand Down
4 changes: 4 additions & 0 deletions chart/openfaas/templates/gateway-dep.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ spec:
labels:
app: gateway
spec:
{{- if and .Values.gateway.topologySpreadConstraints .Values.openfaasPro }}
topologySpreadConstraints:
{{- toYaml .Values.gateway.topologySpreadConstraints | nindent 8 }}
{{- end }}
{{- if .Values.operator.create }}
serviceAccountName: {{ .Release.Name }}-operator
{{- else }}
Expand Down
9 changes: 9 additions & 0 deletions chart/openfaas/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,15 @@ gateway:
failureThreshold: 3
successThreshold: 1

topologySpreadConstraints:
- maxSkew: 1
topologyKey: "kubernetes.io/hostname"
# Set to "DoNotSchedule" if you need a strict enforcement
whenUnsatisfiable: ScheduleAnyway
labelSelector:
matchLabels:
app: gateway

eventSubscription:
endpoint: ""
endpointSecret: ""
Expand Down
Binary file modified docs/cron-connector-0.6.11.tgz
Binary file not shown.
Binary file modified docs/federated-gateway-0.1.0.tgz
Binary file not shown.
1,084 changes: 554 additions & 530 deletions docs/index.yaml

Large diffs are not rendered by default.

Binary file modified docs/kafka-connector-0.7.11.tgz
Binary file not shown.
Binary file modified docs/mqtt-connector-0.4.7.tgz
Binary file not shown.
Binary file modified docs/nats-connector-0.3.2.tgz
Binary file not shown.
Binary file added docs/openfaas-14.2.72.tgz
Binary file not shown.
Binary file modified docs/postgres-connector-0.1.1.tgz
Binary file not shown.
Binary file modified docs/pro-builder-0.4.15.tgz
Binary file not shown.
Binary file modified docs/queue-worker-0.2.9.tgz
Binary file not shown.
Binary file modified docs/sns-connector-0.1.3.tgz
Binary file not shown.
Binary file modified docs/sqs-connector-0.2.6.tgz
Binary file not shown.

0 comments on commit eff7a82

Please sign in to comment.