Skip to content

Commit 9ba893f

Browse files
committed
feat(postgres): Add Component to enable metrics for cluster(s)
ref: #18
1 parent 0b11792 commit 9ba893f

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
---
2+
3+
apiVersion: kustomize.config.k8s.io/v1alpha1
4+
kind: Component
5+
6+
7+
patches:
8+
# yamllint disable rule:indentation
9+
- patch: |-
10+
11+
- op: add
12+
path: /spec/monitoring
13+
value:
14+
enablePodMonitor: true
15+
16+
- op: add
17+
path: /spec/monitoring/podMonitorRelabelings
18+
value:
19+
- sourceLabels: ["__meta_kubernetes_pod_label_cnpg_io_cluster"]
20+
targetLabel: cluster
21+
action: replace
22+
- sourceLabels: ["__meta_kubernetes_pod_name"]
23+
targetLabel: instance
24+
action: replace
25+
# yamllint enable rule:indentation
26+
target:
27+
group: postgresql.cnpg.io
28+
version: v1
29+
kind: Cluster

0 commit comments

Comments
 (0)