File tree Expand file tree Collapse file tree 5 files changed +16
-2
lines changed
Expand file tree Collapse file tree 5 files changed +16
-2
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 @@ -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 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 @@ -2,7 +2,7 @@ apiVersion: apiextensions.k8s.io/v1
22kind : CustomResourceDefinition
33metadata :
44 annotations :
5- controller-gen.kubebuilder.io/version : v0.18.0
5+ controller-gen.kubebuilder.io/version : v0.16.1
66 name : objectstores.barmancloud.cnpg.io
77spec :
88 group : barmancloud.cnpg.io
@@ -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