Skip to content

Commit 8910766

Browse files
inelpandzichorsegegunes
authored
K8SPG-577: Add spec.pmm.querySource (#870)
* Add spec.pmm.querySource. * Set pgstatements as a default. * Set pg_stat_monitor as a default. Load pg_stat_statements if enabled. * Fix test. * Fix * Update CRDs. * Update CRD validation. * Fix config. * Update e2e test. * Fix * Test fix * Fix * Update timeout. * Properly set the extension. * Update test. * Remove unused param. * Update CRDs * Set querySource default to pgstatmonitor. * fix defults in cr.yaml * Update pkg/apis/pgv2.percona.com/v2/perconapgcluster_types.go Co-authored-by: Ege Güneş <[email protected]> --------- Co-authored-by: Viacheslav Sarzhan <[email protected]> Co-authored-by: Ege Güneş <[email protected]>
1 parent 50741ff commit 8910766

File tree

19 files changed

+235
-8
lines changed

19 files changed

+235
-8
lines changed

build/crd/crunchy/generated/postgres-operator.crunchydata.com_postgresclusters.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8224,6 +8224,8 @@ spec:
82248224
type: boolean
82258225
pgStatMonitor:
82268226
type: boolean
8227+
pgStatStatements:
8228+
type: boolean
82278229
type: object
82288230
image:
82298231
description: |-

build/crd/percona/generated/pgv2.percona.com_perconapgclusters.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13535,6 +13535,12 @@ spec:
1353513535
- Never
1353613536
- IfNotPresent
1353713537
type: string
13538+
querySource:
13539+
default: pgstatmonitor
13540+
enum:
13541+
- pgstatmonitor
13542+
- pgstatstatements
13543+
type: string
1353813544
resources:
1353913545
description: Compute resources of a PMM container.
1354013546
properties:
@@ -13603,6 +13609,7 @@ spec:
1360313609
required:
1360413610
- enabled
1360513611
- image
13612+
- querySource
1360613613
- secret
1360713614
- serverHost
1360813615
type: object

config/crd/bases/pgv2.percona.com_perconapgclusters.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13940,6 +13940,12 @@ spec:
1394013940
- Never
1394113941
- IfNotPresent
1394213942
type: string
13943+
querySource:
13944+
default: pgstatmonitor
13945+
enum:
13946+
- pgstatmonitor
13947+
- pgstatstatements
13948+
type: string
1394313949
resources:
1394413950
description: Compute resources of a PMM container.
1394513951
properties:
@@ -14008,6 +14014,7 @@ spec:
1400814014
required:
1400914015
- enabled
1401014016
- image
14017+
- querySource
1401114018
- secret
1401214019
- serverHost
1401314020
type: object

config/crd/bases/postgres-operator.crunchydata.com_postgresclusters.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8184,6 +8184,8 @@ spec:
81848184
type: boolean
81858185
pgStatMonitor:
81868186
type: boolean
8187+
pgStatStatements:
8188+
type: boolean
81878189
type: object
81888190
image:
81898191
description: |-

deploy/bundle.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14233,6 +14233,12 @@ spec:
1423314233
- Never
1423414234
- IfNotPresent
1423514235
type: string
14236+
querySource:
14237+
default: pgstatmonitor
14238+
enum:
14239+
- pgstatmonitor
14240+
- pgstatstatements
14241+
type: string
1423614242
resources:
1423714243
description: Compute resources of a PMM container.
1423814244
properties:
@@ -14301,6 +14307,7 @@ spec:
1430114307
required:
1430214308
- enabled
1430314309
- image
14310+
- querySource
1430414311
- secret
1430514312
- serverHost
1430614313
type: object
@@ -33661,6 +33668,8 @@ spec:
3366133668
type: boolean
3366233669
pgStatMonitor:
3366333670
type: boolean
33671+
pgStatStatements:
33672+
type: boolean
3366433673
type: object
3366533674
image:
3366633675
description: |-

deploy/cr.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -448,6 +448,7 @@ spec:
448448
# imagePullPolicy: IfNotPresent
449449
secret: cluster1-pmm-secret
450450
serverHost: monitoring-service
451+
# querySource: pgstatmonitor
451452
# patroni:
452453
# # Some values of the Liveness/Readiness probes of the patroni container are calulated using syncPeriodSeconds by the following formulas:
453454
# # - timeoutSeconds: syncPeriodSeconds / 2;

deploy/crd.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14233,6 +14233,12 @@ spec:
1423314233
- Never
1423414234
- IfNotPresent
1423514235
type: string
14236+
querySource:
14237+
default: pgstatmonitor
14238+
enum:
14239+
- pgstatmonitor
14240+
- pgstatstatements
14241+
type: string
1423614242
resources:
1423714243
description: Compute resources of a PMM container.
1423814244
properties:
@@ -14301,6 +14307,7 @@ spec:
1430114307
required:
1430214308
- enabled
1430314309
- image
14310+
- querySource
1430414311
- secret
1430514312
- serverHost
1430614313
type: object
@@ -33661,6 +33668,8 @@ spec:
3366133668
type: boolean
3366233669
pgStatMonitor:
3366333670
type: boolean
33671+
pgStatStatements:
33672+
type: boolean
3366433673
type: object
3366533674
image:
3366633675
description: |-

deploy/cw-bundle.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14233,6 +14233,12 @@ spec:
1423314233
- Never
1423414234
- IfNotPresent
1423514235
type: string
14236+
querySource:
14237+
default: pgstatmonitor
14238+
enum:
14239+
- pgstatmonitor
14240+
- pgstatstatements
14241+
type: string
1423614242
resources:
1423714243
description: Compute resources of a PMM container.
1423814244
properties:
@@ -14301,6 +14307,7 @@ spec:
1430114307
required:
1430214308
- enabled
1430314309
- image
14310+
- querySource
1430414311
- secret
1430514312
- serverHost
1430614313
type: object
@@ -33661,6 +33668,8 @@ spec:
3366133668
type: boolean
3366233669
pgStatMonitor:
3366333670
type: boolean
33671+
pgStatStatements:
33672+
type: boolean
3366433673
type: object
3366533674
image:
3366633675
description: |-
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
apiVersion: kuttl.dev/v1beta1
2+
kind: TestStep
3+
commands:
4+
- script: |-
5+
set -o errexit
6+
set -o xtrace
7+
8+
source ../../functions
9+
10+
kubectl -n ${NAMESPACE} patch perconapgcluster/monitoring --type=merge -p '{"spec":{"pmm":{"querySource":"pgstatstatements"}}}'
11+
12+
# Wait for the pg_stat_statements extension to be created
13+
sleep 60
14+
15+
primary=$(get_pod_by_role monitoring master name)
16+
res=$(kubectl -n ${NAMESPACE} exec ${primary} -- bash -c 'psql -c "SELECT extname FROM pg_extension;"')
17+
echo ${res} | grep -q pg_stat_statements

e2e-tests/tests/monitoring/06-check-password-leak.yaml renamed to e2e-tests/tests/monitoring/07-check-password-leak.yaml

File renamed without changes.

0 commit comments

Comments
 (0)