File tree Expand file tree Collapse file tree 3 files changed +10
-16
lines changed
Expand file tree Collapse file tree 3 files changed +10
-16
lines changed Original file line number Diff line number Diff line change @@ -52,9 +52,10 @@ func NewCmd() *cobra.Command {
5252 },
5353 }
5454
55- cmd .Flags ().Bool ("pprof-server" ,
56- false ,
57- "If true it will start a pprof debug http server on localhost:6061. Defaults to false." ,
55+ cmd .Flags ().String ("pprof-server" ,
56+ "" ,
57+ "The address where pprof server should be exposed, for example: 0.0.0.0:6061. " +
58+ "Empty string means disabled. Disabled by default" ,
5859 )
5960 _ = viper .BindPFlag ("pprof-server" , cmd .Flags ().Lookup ("pprof-server" ))
6061
Original file line number Diff line number Diff line change @@ -52,7 +52,7 @@ func Start(ctx context.Context) error {
5252 namespace := viper .GetString ("namespace" )
5353
5454 controllerOptions := ctrl.Options {
55- PprofBindAddress : getPprofServerAddress ( ),
55+ PprofBindAddress : viper . GetString ( "pprof-server" ),
5656 Scheme : scheme ,
5757 Client : client.Options {
5858 // Important: the caching options below are used by
@@ -149,11 +149,3 @@ func generateScheme(ctx context.Context) *runtime.Scheme {
149149
150150 return result
151151}
152-
153- func getPprofServerAddress () string {
154- if viper .GetBool ("pprof-server" ) {
155- return "0.0.0.0:6061"
156- }
157-
158- return ""
159- }
Original file line number Diff line number Diff line change @@ -77,10 +77,11 @@ For a complete list of supported options, refer to the
7777
7878## Enable the pprof debug server for the sidecar
7979
80- You can enable the instance sidecar's pprof debug HTTP server by adding the ` --pprof-server` flag to the container's
81- arguments via `.spec.instanceSidecarConfiguration.additionalContainerArgs` in the `ObjectStore` resource .
80+ You can enable the instance sidecar's pprof debug HTTP server by adding the ` --pprof-server=<address> ` flag to the container's
81+ arguments via `.spec.instanceSidecarConfiguration.additionalContainerArgs`.
8282
83- This starts a pprof server on port 6061 inside the Pod.
83+ Pass a bind address in the form `<host>:<port>` (for example, `0.0.0.0:6061`).
84+ An empty value disables the server (disabled by default).
8485
8586# ## Example
8687
@@ -92,5 +93,5 @@ metadata:
9293spec:
9394 instanceSidecarConfiguration:
9495 additionalContainerArgs:
95- - "--pprof-server"
96+ - "--pprof-server=0.0.0.0:6061 "
9697` ` `
You can’t perform that action at this time.
0 commit comments