fix(prometheus): postgres_exporter config

This commit is contained in:
Rob Watson 2025-04-27 11:53:05 +02:00
parent 8cb2e80c80
commit 0524f640c2
2 changed files with 21 additions and 1 deletions

View File

@ -60,6 +60,7 @@ configMapGenerator:
secretGenerator:
- name: prometheus-credentials
namespace: prometheus
files:
- secrets/exporter-password
- name: grafana-credentials
@ -68,6 +69,25 @@ secretGenerator:
- admin-password=secrets/grafana-admin-password
patches:
# Patch prometheus-server pod to mount the secrets volume.
- target:
kind: Deployment
name: prometheus-server
namespace: prometheus
patch: |-
- op: add
path: /spec/template/spec/volumes/-
value:
secret:
secretName: prod-prometheus-credentials
name: secrets-volume
- op: add
path: /spec/template/spec/containers/1/volumeMounts/-
value:
mountPath: /etc/secrets
name: secrets-volume
readOnly: true
# Patch Grafana deployment to inject PostgreSQL credentials:
- target:
kind: Deployment

View File

@ -318,7 +318,7 @@ scrape_configs:
tls_config:
insecure_skip_verify: true
static_configs:
- targets: ["prod-db:9100", "prod-db:9187"]
- targets: ["prod-db.default:9100", "prod-db.default:9187"]
alerting:
alertmanagers:
- kubernetes_sd_configs: