Skip to content

Commit eff7a82

Browse files
committed
Add topologySpreadConstraints for gateway
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) <alexellis2@gmail.com>
1 parent 8d711d2 commit eff7a82

15 files changed

+568
-531
lines changed

chart/openfaas/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ apiVersion: v2
22
type: application
33
description: OpenFaaS - Serverless Functions Made Simple
44
name: openfaas
5-
version: 14.2.71
5+
version: 14.2.72
66
sources:
77
- https://github.com/openfaas/faas
88
- https://github.com/openfaas/faas-netes

chart/openfaas/templates/gateway-dep.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,10 @@ spec:
3030
labels:
3131
app: gateway
3232
spec:
33+
{{- if and .Values.gateway.topologySpreadConstraints .Values.openfaasPro }}
34+
topologySpreadConstraints:
35+
{{- toYaml .Values.gateway.topologySpreadConstraints | nindent 8 }}
36+
{{- end }}
3337
{{- if .Values.operator.create }}
3438
serviceAccountName: {{ .Release.Name }}-operator
3539
{{- else }}

chart/openfaas/values.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,15 @@ gateway:
110110
failureThreshold: 3
111111
successThreshold: 1
112112

113+
topologySpreadConstraints:
114+
- maxSkew: 1
115+
topologyKey: "kubernetes.io/hostname"
116+
# Set to "DoNotSchedule" if you need a strict enforcement
117+
whenUnsatisfiable: ScheduleAnyway
118+
labelSelector:
119+
matchLabels:
120+
app: gateway
121+
113122
eventSubscription:
114123
endpoint: ""
115124
endpointSecret: ""

docs/cron-connector-0.6.11.tgz

-1 Bytes
Binary file not shown.

docs/federated-gateway-0.1.0.tgz

1 Byte
Binary file not shown.

docs/index.yaml

Lines changed: 554 additions & 530 deletions
Large diffs are not rendered by default.

docs/kafka-connector-0.7.11.tgz

-1 Bytes
Binary file not shown.

docs/mqtt-connector-0.4.7.tgz

0 Bytes
Binary file not shown.

docs/nats-connector-0.3.2.tgz

0 Bytes
Binary file not shown.

docs/openfaas-14.2.72.tgz

61 KB
Binary file not shown.

0 commit comments

Comments
 (0)