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 @@ -33,9 +33,10 @@ func NewCmd() *cobra.Command {
3333 },
3434 }
3535
36- cmd .Flags ().Bool ("pprof-server" ,
37- false ,
38- "If true it will start a pprof debug http server on localhost:6061. Defaults to false." ,
36+ cmd .Flags ().String ("pprof-server" ,
37+ "" ,
38+ "The address where pprof server should be exposed, for example: 0.0.0.0:6061. " +
39+ "Empty string means disabled. Disabled by default" ,
3940 )
4041 _ = viper .BindPFlag ("pprof-server" , cmd .Flags ().Lookup ("pprof-server" ))
4142
Original file line number Diff line number Diff line change @@ -33,7 +33,7 @@ func Start(ctx context.Context) error {
3333 namespace := viper .GetString ("namespace" )
3434
3535 controllerOptions := ctrl.Options {
36- PprofBindAddress : getPprofServerAddress ( ),
36+ PprofBindAddress : viper . GetString ( "pprof-server" ),
3737 Scheme : scheme ,
3838 Client : client.Options {
3939 // Important: the caching options below are used by
@@ -130,11 +130,3 @@ func generateScheme(ctx context.Context) *runtime.Scheme {
130130
131131 return result
132132}
133-
134- func getPprofServerAddress () string {
135- if viper .GetBool ("pprof-server" ) {
136- return "0.0.0.0:6061"
137- }
138-
139- return ""
140- }
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