Skip to content

Commit deb0d0d

Browse files
committed
Refactor chart for faas-netes pro
* faas-netes pro is a new version of the original controller in openfaas-ce, it comes with production settings and additional functionality Signed-off-by: Alex Ellis (OpenFaaS Ltd) <[email protected]>
1 parent b38aeb0 commit deb0d0d

File tree

4 files changed

+62
-12
lines changed

4 files changed

+62
-12
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: 10.0.8
5+
version: 10.0.9
66
sources:
77
- https://github.com/openfaas/faas
88
- https://github.com/openfaas/faas-netes

chart/openfaas/templates/gateway-dep.yaml

Lines changed: 40 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,11 @@ spec:
3636
secret:
3737
secretName: basic-auth
3838
{{- end }}
39+
{{- if .Values.openfaasPro }}
40+
- name: license
41+
secret:
42+
secretName: openfaas-license
43+
{{- end }}
3944
containers:
4045
- name: gateway
4146
resources:
@@ -144,12 +149,17 @@ spec:
144149
value: "{{ .Values.gateway.maxIdleConns }}"
145150
- name: max_idle_conns_per_host
146151
value: "{{ .Values.gateway.maxIdleConnsPerHost }}"
147-
{{- if .Values.basic_auth }}
148152
volumeMounts:
153+
{{- if .Values.basic_auth }}
149154
- name: auth
150155
readOnly: true
151156
mountPath: "/var/secrets"
152157
{{- end }}
158+
{{- if .Values.openfaasPro }}
159+
- name: license
160+
readOnly: true
161+
mountPath: "/var/secrets/license"
162+
{{- end }}
153163
ports:
154164
- name: http
155165
containerPort: 8080
@@ -158,11 +168,18 @@ spec:
158168
- name: operator
159169
resources:
160170
{{- .Values.operator.resources | toYaml | nindent 12 }}
171+
{{- if .Values.openfaasPro }}
172+
image: {{ .Values.operatorPro.image }}
173+
{{- else }}
161174
image: {{ .Values.operator.image }}
175+
{{- end }}
162176
imagePullPolicy: {{ .Values.openfaasImagePullPolicy }}
163177
command:
164178
- ./faas-netes
165179
- -operator=true
180+
{{- if .Values.openfaasPro }}
181+
- "-license-file=/var/secrets/license/license"
182+
{{- end }}
166183
env:
167184
- name: port
168185
value: "8081"
@@ -197,17 +214,34 @@ spec:
197214
ports:
198215
- containerPort: 8081
199216
protocol: TCP
217+
{{- if .Values.openfaasPro }}
218+
volumeMounts:
219+
- name: license
220+
readOnly: true
221+
mountPath: "/var/secrets/license"
222+
{{- end }}
223+
200224
{{- else }}
201225
- name: faas-netes
202226
resources:
203227
{{- .Values.faasnetes.resources | toYaml | nindent 12 }}
228+
{{- if .Values.openfaasPro }}
229+
image: {{ .Values.faasnetesPro.image }}
230+
{{- else }}
204231
image: {{ .Values.faasnetes.image }}
232+
{{- end }}
205233
imagePullPolicy: {{ .Values.openfaasImagePullPolicy }}
206234
{{- if .Values.securityContext }}
207235
securityContext:
208236
readOnlyRootFilesystem: true
209237
runAsUser: 10001
210238
{{- end }}
239+
command:
240+
- ./faas-netes
241+
- -operator=false
242+
{{- if .Values.openfaasPro }}
243+
- "-license-file=/var/secrets/license/license"
244+
{{- end }}
211245
env:
212246
- name: port
213247
value: "8081"
@@ -240,6 +274,11 @@ spec:
240274
- name: cluster_role
241275
value: "{{ .Values.clusterRole }}"
242276
volumeMounts:
277+
{{- if .Values.openfaasPro }}
278+
- name: license
279+
readOnly: true
280+
mountPath: "/var/secrets/license"
281+
{{- end }}
243282
- mountPath: /tmp
244283
name: faas-netes-temp-volume
245284
ports:

chart/openfaas/templates/queueworker-dep.yaml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@ spec:
2828
secret:
2929
secretName: basic-auth
3030
{{- end }}
31-
{{- if .Values.queueWorkerPro.enabled }}
31+
32+
{{- if .Values.openfaasPro }}
3233
- name: license
3334
secret:
3435
secretName: openfaas-license
@@ -37,13 +38,13 @@ spec:
3738
- name: queue-worker
3839
resources:
3940
{{- .Values.queueWorker.resources | toYaml | nindent 12 }}
40-
{{- if .Values.queueWorkerPro.enabled }}
41+
{{- if .Values.openfaasPro }}
4142
image: {{ .Values.queueWorkerPro.image }}
4243
{{- else }}
4344
image: {{ .Values.queueWorker.image }}
4445
{{- end }}
4546
imagePullPolicy: {{ .Values.openfaasImagePullPolicy }}
46-
{{- if .Values.queueWorkerPro.enabled }}
47+
{{- if .Values.openfaasPro }}
4748
command:
4849
- "/worker"
4950
- "-license-file=/var/secrets/license/license"
@@ -97,7 +98,7 @@ spec:
9798
- name: basic_auth
9899
value: "{{ .Values.basic_auth }}"
99100
volumeMounts:
100-
{{- if .Values.queueWorkerPro.enabled }}
101+
{{- if .Values.openfaasPro }}
101102
- name: license
102103
readOnly: true
103104
mountPath: "/var/secrets/license"

chart/openfaas/values.yaml

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,9 @@ openfaasImagePullPolicy: "Always"
3030
# openfaasPro components, which require openfaasPro=true
3131
# clusterRole is also recommended for collecting CPU/RAM metrics for Pro add-ons
3232

33-
# advanced scaling on concurrency and CPU
33+
# OpenFaaS Pro
34+
# Advanced auto-scaling on RPS, CPU and in-flight requests
35+
# Includes: scale to zero
3436
proScaler:
3537
image: alexellis2/openfaas-pro-scaler:0.1.3
3638
replicas: 1
@@ -41,20 +43,22 @@ proScaler:
4143
limits:
4244
memory: "256Mi"
4345

44-
# Not required if using proScaler
45-
# scale-to-zero feature
46+
# OpenFaaS Pro
47+
# Original scale to zero feature
48+
# set "enabled=false" when using proScaler
4649
faasIdler:
4750
image: ghcr.io/openfaas/faas-idler-pro:0.4.4
4851
replicas: 1
4952
enabled: false
50-
inactivityDuration: 3m # If a function is inactive for 15 minutes, it may be scaled to zero
53+
inactivityDuration: 3m # If a function is inactive for 15 minutes, it may be scaled to zero
5154
reconcileInterval: 2m # The interval between each attempt to scale functions to zero
5255
readOnly: false # When set to true, no functions are scaled to zero
5356
writeDebug: false # Write additional debug information
5457
resources:
5558
requests:
5659
memory: "64Mi"
5760

61+
# OpenFaaS Pro
5862
# OIDC plugin for authentication on the OpenFaaS REST API
5963
oidcAuthPlugin:
6064
enabled: false
@@ -105,6 +109,11 @@ basicAuthPlugin:
105109
memory: "50Mi"
106110
cpu: "20m"
107111

112+
faasnetesPro:
113+
image: ghcr.io/openfaasltd/faas-netes:0.1.0-rc3
114+
operatorPro:
115+
image: ghcr.io/openfaasltd/faas-netes:0.1.0-rc3
116+
108117
faasnetes:
109118
image: ghcr.io/openfaas/faas-netes:0.14.1
110119
readTimeout: "60s"
@@ -137,10 +146,11 @@ operator:
137146
memory: "120Mi"
138147
cpu: "50m"
139148

140-
# Requires openfaas PRO subscription
149+
# OpenFaaS Pro
150+
# The values for queueWorkerPro are merged with those under
151+
# the "queueWorker" section
141152
queueWorkerPro:
142153
image: ghcr.io/openfaas/queue-worker-pro:0.1.0-rc5
143-
enabled: false
144154
maxRetryAttempts: "10"
145155
maxRetryWait: "120s"
146156
initialRetryWait: "10s"

0 commit comments

Comments
 (0)