From 2d0b4ca315f5f44b4d85417eb7b775885a18d3be Mon Sep 17 00:00:00 2001 From: Benjamin Gentil Date: Thu, 23 Jul 2026 19:47:06 +0200 Subject: [PATCH] feat(manager): add --pprof-bind-address flag (#1220) Expose a --pprof-bind-address CLI flag that wires controller-runtime's PprofBindAddress option. When set (e.g. ":6767"), the controller manager starts a pprof endpoint for runtime profiling. When left empty (the default), no pprof server is started, preserving the existing behavior. --- cmd/manager/cmd.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cmd/manager/cmd.go b/cmd/manager/cmd.go index 76c9819..a562a16 100644 --- a/cmd/manager/cmd.go +++ b/cmd/manager/cmd.go @@ -46,6 +46,7 @@ func NewCmd(scheme *runtime.Scheme) *cobra.Command { var ( metricsBindAddress string healthProbeBindAddress string + pprofBindAddress string leaderElect bool tmpDirectory string kineImage string @@ -114,6 +115,7 @@ func NewCmd(scheme *runtime.Scheme) *cobra.Command { Metrics: metricsserver.Options{ BindAddress: metricsBindAddress, }, + PprofBindAddress: pprofBindAddress, WebhookServer: ctrlwebhook.NewServer(ctrlwebhook.Options{ Port: 9443, }), @@ -323,6 +325,7 @@ func NewCmd(scheme *runtime.Scheme) *cobra.Command { // Setting CLI flags cmd.Flags().StringVar(&metricsBindAddress, "metrics-bind-address", ":8080", "The address the metric endpoint binds to.") cmd.Flags().StringVar(&healthProbeBindAddress, "health-probe-bind-address", ":8081", "The address the probe endpoint binds to.") + cmd.Flags().StringVar(&pprofBindAddress, "pprof-bind-address", "", "The address the pprof profiler binds to.") cmd.Flags().BoolVar(&leaderElect, "leader-elect", true, "Enable leader election for controller manager. Enabling this will ensure there is only one active controller manager.") cmd.Flags().StringVar(&tmpDirectory, "tmp-directory", "/tmp/kamaji", "Directory which will be used to work with temporary files.") cmd.Flags().StringVar(&kineImage, "kine-image", "rancher/kine:v0.11.10-amd64", "Container image along with tag to use for the Kine sidecar container (used only if etcd-storage-type is set to one of kine strategies).")