Skip to content

Commit 291ac3e

Browse files
committed
Enable support for pprof for operator
Pprof is already present in the operator, but required manual edits. This commit makes it available via values.yaml for easy use. Signed-off-by: Alex Ellis (OpenFaaS Ltd) <[email protected]>
1 parent 98581dc commit 291ac3e

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

chart/openfaas/templates/gateway-dep.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,10 @@ spec:
266266
- name: leader_election
267267
value: "true"
268268
{{- end }}
269+
{{- if eq (or .Values.operator.pprof false) true }}
270+
- name: pprof
271+
value: {{ .Values.operator.pprof | quote }}
272+
{{- end }}
269273
{{- if .Values.iam.enabled }}
270274
- name: issuer_key_path
271275
value: "/var/secrets/issuer-key/issuer.key"

chart/openfaas/values.yaml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,12 +96,18 @@ operator:
9696
create: false
9797
# Unnecessary when running a single replica of the gateway
9898
leaderElection:
99-
enabled: true
99+
enabled: false
100100
reconcileWorkers: 2
101101
resources:
102102
requests:
103103
memory: "120Mi"
104104
cpu: "50m"
105+
# When set to true, pprof will be enabled, and the
106+
# service "faas-provider" will gain an extra port to
107+
# expose the pprof endpoint, this cannot be used in production
108+
# since it may bypass authentication, and should only be used
109+
# for debugging purposes
110+
pprof: false
105111

106112
# For OpenFaaS for Enterprises, these numbers can be set higher,
107113
# if experiencing rate limiting due to a large number of functions

0 commit comments

Comments
 (0)