diff --git a/cmd/gpu-operator/main.go b/cmd/gpu-operator/main.go index 281e2667c9..5d6450e810 100644 --- a/cmd/gpu-operator/main.go +++ b/cmd/gpu-operator/main.go @@ -78,9 +78,12 @@ func main() { var enableLeaderElection bool var leaderElectionNamespace string var probeAddr string + var pprofAddr string var renewDeadline time.Duration flag.StringVar(&metricsAddr, "metrics-bind-address", ":8080", "The address the metric endpoint binds to.") + flag.StringVar(&pprofAddr, "pprof-bind-address", "", + "The address the pprof endpoint binds to (e.g. \":6060\"). Disabled when empty.") flag.StringVar(&probeAddr, "health-probe-bind-address", ":8081", "The address the probe endpoint binds to.") flag.BoolVar(&enableLeaderElection, "leader-elect", false, "Enable leader election for controller manager. "+ @@ -136,6 +139,7 @@ func main() { Scheme: scheme, Metrics: metricsOptions, HealthProbeBindAddress: probeAddr, + PprofBindAddress: pprofAddr, LeaderElection: enableLeaderElection, LeaderElectionNamespace: leaderElectionNamespace, LeaderElectionID: "53822513.nvidia.com", diff --git a/deployments/gpu-operator/templates/operator.yaml b/deployments/gpu-operator/templates/operator.yaml index 484f83e088..984d7be0a4 100644 --- a/deployments/gpu-operator/templates/operator.yaml +++ b/deployments/gpu-operator/templates/operator.yaml @@ -49,6 +49,9 @@ spec: {{- if .Values.operator.logging.level }} - --zap-log-level={{- .Values.operator.logging.level }} {{- end }} + {{- end }} + {{- if .Values.operator.pprof.bindAddress }} + - --pprof-bind-address={{ .Values.operator.pprof.bindAddress }} {{- end }} env: - name: WATCH_NAMESPACE diff --git a/deployments/gpu-operator/values.yaml b/deployments/gpu-operator/values.yaml index 45947b26cc..f6222b0d5c 100644 --- a/deployments/gpu-operator/values.yaml +++ b/deployments/gpu-operator/values.yaml @@ -111,6 +111,9 @@ operator: # Development Mode defaults(encoder=consoleEncoder,logLevel=Debug,stackTraceLevel=Warn) # Production Mode defaults(encoder=jsonEncoder,logLevel=Info,stackTraceLevel=Error) develMode: false + pprof: + # Bind address for the pprof profiling endpoint (e.g. ":6060"). Disabled when empty. + bindAddress: "" resources: limits: cpu: 500m