Skip to content

Commit f659c0b

Browse files
authored
Merge branch 'main' into docs-troubleshooting
2 parents 96e4621 + 367db3c commit f659c0b

File tree

8 files changed

+456
-383
lines changed

8 files changed

+456
-383
lines changed

.wordlist.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,7 @@ pluginConfiguration
128128
podName
129129
postgres
130130
postgresql
131+
pprof
131132
primaryUpdateStrategy
132133
rbac
133134
rc

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ toolchain go1.25.4
77
require (
88
github.com/cert-manager/cert-manager v1.19.1
99
github.com/cloudnative-pg/api v1.27.0
10-
github.com/cloudnative-pg/barman-cloud v0.3.3
10+
github.com/cloudnative-pg/barman-cloud v0.3.4-0.20251203100017-1d476f125c5b
1111
github.com/cloudnative-pg/cloudnative-pg v1.27.1
1212
github.com/cloudnative-pg/cnpg-i v0.3.0
1313
github.com/cloudnative-pg/cnpg-i-machinery v0.4.1

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UF
1818
github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
1919
github.com/cloudnative-pg/api v1.27.0 h1:uSUkF9X/0UZu1Xn5qI33qHVmzZrDKuuyoiRlsOmSTv4=
2020
github.com/cloudnative-pg/api v1.27.0/go.mod h1:IWyAmuirffHiw6iIGD1p18BmZNb13TK9Os/wkp8ltDg=
21-
github.com/cloudnative-pg/barman-cloud v0.3.3 h1:EEcjeV+IUivDpmyF/H/XGY1pGaKJ5LS5MYeB6wgGcak=
22-
github.com/cloudnative-pg/barman-cloud v0.3.3/go.mod h1:5CM4MncAxAjnqxjDt0I5E/oVd7gsMLL0/o/wQ+vUSgs=
21+
github.com/cloudnative-pg/barman-cloud v0.3.4-0.20251203100017-1d476f125c5b h1:7qpnZpOkmjhs0Prasu8laSaiEQ7eC2qW1xA39mQ/aEc=
22+
github.com/cloudnative-pg/barman-cloud v0.3.4-0.20251203100017-1d476f125c5b/go.mod h1:F6JqmFpa3V0/8paxu372tvxH7F6NrfUbtul3zrsoy+k=
2323
github.com/cloudnative-pg/cloudnative-pg v1.27.1 h1:w+bbtXyEPoaa7sZGXxbb8qJ+/bUGWQ3M48kbNUEpKlk=
2424
github.com/cloudnative-pg/cloudnative-pg v1.27.1/go.mod h1:XbwCAlCm5fr+/A+v+qvMp8DHzVtJr2m0Y/TpKALw+Bk=
2525
github.com/cloudnative-pg/cnpg-i v0.3.0 h1:5ayNOG5x68lU70IVbHDZQrv5p+bErCJ0mqRmOpW2jjE=

internal/cmd/instance/main.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,13 @@ func NewCmd() *cobra.Command {
5252
},
5353
}
5454

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",
59+
)
60+
_ = viper.BindPFlag("pprof-server", cmd.Flags().Lookup("pprof-server"))
61+
5562
_ = viper.BindEnv("namespace", "NAMESPACE")
5663
_ = viper.BindEnv("cluster-name", "CLUSTER_NAME")
5764
_ = viper.BindEnv("pod-name", "POD_NAME")

internal/cnpgi/instance/manager.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,8 @@ func Start(ctx context.Context) error {
5252
namespace := viper.GetString("namespace")
5353

5454
controllerOptions := ctrl.Options{
55-
Scheme: scheme,
55+
PprofBindAddress: viper.GetString("pprof-server"),
56+
Scheme: scheme,
5657
Client: client.Options{
5758
// Important: the caching options below are used by
5859
// controller-runtime only.

internal/cnpgi/restore/restore.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ func (impl JobHookImpl) Restore(
157157

158158
config := getRestoreWalConfig()
159159

160-
contextLogger.Info("sending restore response", "config", config, "env", env)
160+
contextLogger.Info("sending restore response", "config", config)
161161
return &restore.RestoreResponse{
162162
RestoreConfig: config,
163163
Envs: nil,

web/docs/misc.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,3 +74,24 @@ spec:
7474
7575
For a complete list of supported options, refer to the
7676
[official Barman Cloud documentation](https://docs.pgbarman.org/release/latest/).
77+
78+
## Enable the pprof debug server for the sidecar
79+
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`.
82+
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).
85+
86+
### Example
87+
88+
```yaml
89+
apiVersion: barmancloud.cnpg.io/v1
90+
kind: ObjectStore
91+
metadata:
92+
name: my-store
93+
spec:
94+
instanceSidecarConfiguration:
95+
additionalContainerArgs:
96+
- "--pprof-server=0.0.0.0:6061"
97+
```

web/yarn.lock

Lines changed: 421 additions & 378 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)