diff --git a/chart/openfaas/templates/gateway-dep.yaml b/chart/openfaas/templates/gateway-dep.yaml index f222dc8b7..b9d74bde9 100644 --- a/chart/openfaas/templates/gateway-dep.yaml +++ b/chart/openfaas/templates/gateway-dep.yaml @@ -266,6 +266,10 @@ spec: - name: leader_election value: "true" {{- end }} + {{- if eq (or .Values.operator.pprof false) true }} + - name: pprof + value: {{ .Values.operator.pprof | quote }} + {{- end }} {{- if .Values.iam.enabled }} - name: issuer_key_path value: "/var/secrets/issuer-key/issuer.key" diff --git a/chart/openfaas/templates/gateway-provider-svc.yaml b/chart/openfaas/templates/gateway-provider-svc.yaml index d8c7e0d7c..d7c0295fe 100644 --- a/chart/openfaas/templates/gateway-provider-svc.yaml +++ b/chart/openfaas/templates/gateway-provider-svc.yaml @@ -22,6 +22,13 @@ spec: port: 8081 targetPort: 8081 protocol: TCP + +{{- if eq (or .Values.operator.pprof false) true }} + - name: provider + port: 8082 + targetPort: 8082 + protocol: TCP +{{- end }} selector: app: gateway diff --git a/chart/openfaas/values.yaml b/chart/openfaas/values.yaml index b5ab29331..30ccc2496 100644 --- a/chart/openfaas/values.yaml +++ b/chart/openfaas/values.yaml @@ -96,12 +96,18 @@ operator: create: false # Unnecessary when running a single replica of the gateway leaderElection: - enabled: true + enabled: false reconcileWorkers: 2 resources: requests: memory: "120Mi" cpu: "50m" + # When set to true, pprof will be enabled, and the + # service "faas-provider" will gain an extra port to + # expose the pprof endpoint, this cannot be used in production + # since it may bypass authentication, and should only be used + # for debugging purposes + pprof: false # For OpenFaaS for Enterprises, these numbers can be set higher, # if experiencing rate limiting due to a large number of functions