add monitoring to crunchy postgres
This commit is contained in:
parent
be0f0bc52e
commit
a786069bcc
3 changed files with 46 additions and 1 deletions
|
@ -5,6 +5,7 @@ kind: Kustomization
|
|||
resources:
|
||||
- ./externalsecret.yaml
|
||||
- ./gatus.yaml
|
||||
- ./podmonitor.yaml
|
||||
- ./postgrescluster.yaml
|
||||
- ./pushsecret.yaml
|
||||
- ./service.yaml
|
||||
|
|
|
@ -0,0 +1,38 @@
|
|||
---
|
||||
# yaml-language-server: $schema=https://ks.hsn.dev/monitoring.coreos.com/podmonitor_v1.json
|
||||
apiVersion: monitoring.coreos.com/v1
|
||||
kind: PodMonitor
|
||||
metadata:
|
||||
name: cpgo-postgres
|
||||
spec:
|
||||
jobLabel: cpgo-postgres
|
||||
namespaceSelector:
|
||||
matchNames:
|
||||
- database
|
||||
podMetricsEndpoints:
|
||||
- honorLabels: true
|
||||
path: /metrics
|
||||
port: exporter
|
||||
relabelings:
|
||||
- sourceLabels:
|
||||
[
|
||||
"__meta_kubernetes_namespace",
|
||||
"__meta_kubernetes_pod_label_postgres_operator_crunchydata_com_cluster",
|
||||
]
|
||||
targetLabel: pg_cluster
|
||||
separator: "/"
|
||||
replacement: "$1$2"
|
||||
- sourceLabels:
|
||||
[
|
||||
__meta_kubernetes_pod_label_postgres_operator_crunchydata_com_instance,
|
||||
]
|
||||
targetLabel: deployment
|
||||
- sourceLabels:
|
||||
[__meta_kubernetes_pod_label_postgres_operator_crunchydata_com_role]
|
||||
targetLabel: role
|
||||
- sourceLabels: [__meta_kubernetes_pod_name]
|
||||
targetLabel: instance
|
||||
selector:
|
||||
matchLabels:
|
||||
postgres-operator.crunchydata.com/cluster: postgres
|
||||
postgres-operator.crunchydata.com/crunchy-postgres-exporter: "true"
|
|
@ -23,7 +23,13 @@ spec:
|
|||
pgmonitor:
|
||||
exporter:
|
||||
# https://github.com/CrunchyData/postgres-operator-examples/blob/main/helm/install/values.yaml
|
||||
image: registry.developers.crunchydata.com/crunchydata/crunchy-postgres-exporter:ubi8-0.15.0-3
|
||||
# image: registry.developers.crunchydata.com/crunchydata/crunchy-postgres-exporter:ubi8-0.15.0-12
|
||||
resources:
|
||||
requests:
|
||||
cpu: 10m
|
||||
memory: 64M
|
||||
limits:
|
||||
memory: 512M
|
||||
|
||||
patroni: # turn on sync writes to at least 1 other replica
|
||||
dynamicConfiguration:
|
||||
|
|
Loading…
Reference in a new issue