Skip to content

Commit 465df26

Browse files
committed
Reorder otel kuttl test so that we check pgadmin logs right after we add the instrumentation spec to PGAdmin.
1 parent e503a25 commit 465df26

34 files changed

+179
-57
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
apiVersion: kuttl.dev/v1beta1
2+
kind: TestStep
3+
apply:
4+
- files/05--annotate-cluster.yaml
5+
assert:
6+
- files/05-backup-completed.yaml

testing/kuttl/e2e/otel-logging-and-metrics/06--backup.yaml

-6
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
apiVersion: kuttl.dev/v1beta1
2+
kind: TestStep
3+
apply:
4+
- files/07--add-instrumentation.yaml
5+
assert:
6+
- files/07-instrumentation-added.yaml

testing/kuttl/e2e/otel-logging-and-metrics/08--add-custom-queries.yaml

-6
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
apiVersion: kuttl.dev/v1beta1
2+
kind: TestStep
3+
apply:
4+
- files/09--add-custom-queries.yaml
5+
assert:
6+
- files/09-custom-queries-added.yaml

testing/kuttl/e2e/otel-logging-and-metrics/10--add-logs-exporter.yaml

-6
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
apiVersion: kuttl.dev/v1beta1
2+
kind: TestStep
3+
apply:
4+
- files/11--add-logs-exporter.yaml
5+
assert:
6+
- files/11-logs-exporter-added.yaml

testing/kuttl/e2e/otel-logging-and-metrics/12--cluster-no-backups.yaml

-6
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
apiVersion: kuttl.dev/v1beta1
2+
kind: TestStep
3+
apply:
4+
- files/13--create-cluster.yaml
5+
assert:
6+
- files/13-cluster-created.yaml
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
apiVersion: kuttl.dev/v1beta1
22
kind: TestStep
33
apply:
4-
- files/14--add-backups.yaml
4+
- files/15--add-backups.yaml
55
assert:
6-
- files/14-backups-added.yaml
6+
- files/15-backups-added.yaml

testing/kuttl/e2e/otel-logging-and-metrics/16--annotate-cluster.yaml renamed to testing/kuttl/e2e/otel-logging-and-metrics/17--annotate-cluster.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ commands:
44
- command: kubectl annotate postgrescluster otel-cluster-no-backups postgres-operator.crunchydata.com/authorizeBackupRemoval="true"
55
namespaced: true
66
assert:
7-
- files/16-backups-removed.yaml
7+
- files/17-backups-removed.yaml

testing/kuttl/e2e/otel-logging-and-metrics/files/01--add-instrumentation.yaml

-26
Original file line numberDiff line numberDiff line change
@@ -34,29 +34,3 @@ spec:
3434
proxy:
3535
pgBouncer: {}
3636
instrumentation: {}
37-
---
38-
apiVersion: postgres-operator.crunchydata.com/v1beta1
39-
kind: PGAdmin
40-
metadata:
41-
name: otel-pgadmin
42-
spec:
43-
users:
44-
- username: [email protected]
45-
role: Administrator
46-
passwordRef:
47-
name: pgadmin-password-secret
48-
key: otel-password
49-
dataVolumeClaimSpec:
50-
accessModes:
51-
- "ReadWriteOnce"
52-
resources:
53-
requests:
54-
storage: 1Gi
55-
serverGroups:
56-
- name: supply
57-
# An empty selector selects all postgresclusters in the Namespace
58-
postgresClusterSelector: {}
59-
config:
60-
settings:
61-
AUTHENTICATION_SOURCES: ['internal']
62-
instrumentation: {}

testing/kuttl/e2e/otel-logging-and-metrics/files/01-instrumentation-added.yaml

-4
Original file line numberDiff line numberDiff line change
@@ -99,12 +99,8 @@ metadata:
9999
postgres-operator.crunchydata.com/data: pgadmin
100100
postgres-operator.crunchydata.com/role: pgadmin
101101
postgres-operator.crunchydata.com/pgadmin: otel-pgadmin
102-
postgres-operator.crunchydata.com/crunchy-otel-collector: "true"
103102
status:
104103
containerStatuses:
105-
- name: collector
106-
ready: true
107-
started: true
108104
- name: pgadmin
109105
ready: true
110106
started: true
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
---
2+
apiVersion: postgres-operator.crunchydata.com/v1beta1
3+
kind: PGAdmin
4+
metadata:
5+
name: otel-pgadmin
6+
spec:
7+
users:
8+
- username: [email protected]
9+
role: Administrator
10+
passwordRef:
11+
name: pgadmin-password-secret
12+
key: otel-password
13+
dataVolumeClaimSpec:
14+
accessModes:
15+
- "ReadWriteOnce"
16+
resources:
17+
requests:
18+
storage: 1Gi
19+
serverGroups:
20+
- name: supply
21+
# An empty selector selects all postgresclusters in the Namespace
22+
postgresClusterSelector: {}
23+
config:
24+
settings:
25+
AUTHENTICATION_SOURCES: ['internal']
26+
instrumentation: {}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,120 @@
1+
apiVersion: postgres-operator.crunchydata.com/v1beta1
2+
kind: PostgresCluster
3+
metadata:
4+
name: otel-cluster
5+
status:
6+
instances:
7+
- name: instance1
8+
readyReplicas: 1
9+
replicas: 1
10+
updatedReplicas: 1
11+
proxy:
12+
pgBouncer:
13+
readyReplicas: 1
14+
replicas: 1
15+
---
16+
apiVersion: v1
17+
kind: Pod
18+
metadata:
19+
labels:
20+
postgres-operator.crunchydata.com/data: postgres
21+
postgres-operator.crunchydata.com/role: master
22+
postgres-operator.crunchydata.com/cluster: otel-cluster
23+
postgres-operator.crunchydata.com/crunchy-otel-collector: "true"
24+
status:
25+
containerStatuses:
26+
- name: collector
27+
ready: true
28+
started: true
29+
- name: database
30+
ready: true
31+
started: true
32+
- name: pgbackrest
33+
ready: true
34+
started: true
35+
- name: pgbackrest-config
36+
ready: true
37+
started: true
38+
- name: replication-cert-copy
39+
ready: true
40+
started: true
41+
phase: Running
42+
---
43+
apiVersion: v1
44+
kind: Pod
45+
metadata:
46+
labels:
47+
postgres-operator.crunchydata.com/data: pgbackrest
48+
postgres-operator.crunchydata.com/cluster: otel-cluster
49+
postgres-operator.crunchydata.com/crunchy-otel-collector: "true"
50+
status:
51+
containerStatuses:
52+
- name: collector
53+
ready: true
54+
started: true
55+
- name: pgbackrest
56+
ready: true
57+
started: true
58+
- name: pgbackrest-config
59+
ready: true
60+
started: true
61+
phase: Running
62+
---
63+
apiVersion: v1
64+
kind: Pod
65+
metadata:
66+
labels:
67+
postgres-operator.crunchydata.com/role: pgbouncer
68+
postgres-operator.crunchydata.com/cluster: otel-cluster
69+
postgres-operator.crunchydata.com/crunchy-otel-collector: "true"
70+
status:
71+
containerStatuses:
72+
- name: collector
73+
ready: true
74+
started: true
75+
- name: pgbouncer
76+
ready: true
77+
started: true
78+
- name: pgbouncer-config
79+
ready: true
80+
started: true
81+
phase: Running
82+
---
83+
apiVersion: v1
84+
kind: Service
85+
metadata:
86+
name: otel-cluster-primary
87+
---
88+
apiVersion: v1
89+
kind: ConfigMap
90+
metadata:
91+
labels:
92+
postgres-operator.crunchydata.com/role: pgadmin
93+
postgres-operator.crunchydata.com/pgadmin: otel-pgadmin
94+
---
95+
apiVersion: v1
96+
kind: Pod
97+
metadata:
98+
labels:
99+
postgres-operator.crunchydata.com/data: pgadmin
100+
postgres-operator.crunchydata.com/role: pgadmin
101+
postgres-operator.crunchydata.com/pgadmin: otel-pgadmin
102+
postgres-operator.crunchydata.com/crunchy-otel-collector: "true"
103+
status:
104+
containerStatuses:
105+
- name: collector
106+
ready: true
107+
started: true
108+
- name: pgadmin
109+
ready: true
110+
started: true
111+
phase: Running
112+
---
113+
apiVersion: v1
114+
kind: Secret
115+
metadata:
116+
labels:
117+
postgres-operator.crunchydata.com/role: pgadmin
118+
postgres-operator.crunchydata.com/pgadmin: otel-pgadmin
119+
type: Opaque
120+
---

0 commit comments

Comments
 (0)