File tree Expand file tree Collapse file tree 7 files changed +18
-1
lines changed
Expand file tree Collapse file tree 7 files changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -40,6 +40,7 @@ func NewCmd() *cobra.Command {
4040 _ = viper .BindEnv ("spool-directory" , "SPOOL_DIRECTORY" )
4141 _ = viper .BindEnv ("custom-cnpg-group" , "CUSTOM_CNPG_GROUP" )
4242 _ = viper .BindEnv ("custom-cnpg-version" , "CUSTOM_CNPG_VERSIONXS" )
43+ _ = viper .BindEnv ("pprof-server" , "PLUGIN_PPROF_SERVER" )
4344
4445 return cmd
4546}
Original file line number Diff line number Diff line change @@ -84,5 +84,7 @@ func NewCmd() *cobra.Command {
8484
8585 _ = viper .BindEnv ("sidecar-image" , "SIDECAR_IMAGE" )
8686
87+ _ = viper .BindEnv ("pprof-server" , "PPROF_SERVER" )
88+
8789 return cmd
8890}
Original file line number Diff line number Diff line change @@ -44,6 +44,7 @@ func Start(ctx context.Context) error {
4444 },
4545 },
4646 },
47+ PprofBindAddress : viper .GetString ("pprof-server" ),
4748 }
4849
4950 mgr , err := ctrl .NewManager (ctrl .GetConfigOrDie (), controllerOptions )
Original file line number Diff line number Diff line change @@ -332,7 +332,13 @@ func reconcilePodSpec(
332332 }
333333 sidecarTemplate .RestartPolicy = ptr .To (corev1 .ContainerRestartPolicyAlways )
334334 sidecarTemplate .Resources = config .resources
335-
335+ sidecarTemplate .Ports = []corev1.ContainerPort {
336+ {
337+ Name : "pprof" ,
338+ ContainerPort : 6061 ,
339+ Protocol : corev1 .ProtocolTCP ,
340+ },
341+ }
336342 // merge the main container envs if they aren't already set
337343 for _ , container := range spec .Containers {
338344 if container .Name == mainContainerName {
Original file line number Diff line number Diff line change @@ -104,6 +104,7 @@ func Start(ctx context.Context) error {
104104 Metrics : metricsServerOptions ,
105105 WebhookServer : webhookServer ,
106106 HealthProbeBindAddress : viper .GetString ("health-probe-bind-address" ),
107+ PprofBindAddress : viper .GetString ("pprof-server" ),
107108 LeaderElection : viper .GetBool ("leader-elect" ),
108109 LeaderElectionID : "822e3f5c.cnpg.io" ,
109110 // LeaderElectionReleaseOnCancel defines if the leader should step down voluntarily
Original file line number Diff line number Diff line change 2727 ports :
2828 - containerPort : 9090
2929 protocol : TCP
30+ - containerPort : 6060
31+ protocol : TCP
32+ name : " pprof"
3033 env :
3134 - name : SIDECAR_IMAGE
3235 valueFrom :
Original file line number Diff line number Diff line change @@ -932,6 +932,9 @@ spec:
932932 ports :
933933 - containerPort : 9090
934934 protocol : TCP
935+ - containerPort : 6060
936+ name : pprof
937+ protocol : TCP
935938 readinessProbe :
936939 initialDelaySeconds : 10
937940 periodSeconds : 10
You can’t perform that action at this time.
0 commit comments