diff --git a/deploy/prod-ovh/kustomization.yaml b/deploy/prod-ovh/kustomization.yaml index a6b4b8f..793311d 100644 --- a/deploy/prod-ovh/kustomization.yaml +++ b/deploy/prod-ovh/kustomization.yaml @@ -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 diff --git a/deploy/prod-ovh/resources/prometheus.yaml b/deploy/prod-ovh/resources/prometheus.yaml index 3c696e5..736291e 100644 --- a/deploy/prod-ovh/resources/prometheus.yaml +++ b/deploy/prod-ovh/resources/prometheus.yaml @@ -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: