Skip to content
Snippets Groups Projects
Verified Commit c7442812 authored by Sheogorath's avatar Sheogorath :european_castle:
Browse files

feat(postgres-system): Move sidecar and podMonitor to system namespace

This patch moves the setup of the sidecar containers and the podMonitor
to the `postgres-system` namespace, providing monitoring for all
namespaces, not just for some. Reduces the copy-paste work and should
allow nice insights into all postgres clusters.
parent 45e13cce
No related branches found
No related tags found
No related merge requests found
......@@ -28,36 +28,6 @@ spec:
limits:
cpu: "1"
memory: 3072Mi
sidecars:
- name: "exporter"
image: "quay.io/prometheuscommunity/postgres-exporter"
ports:
- name: exporter
containerPort: 9187
protocol: TCP
resources:
limits:
cpu: 500m
memory: 256M
requests:
cpu: 100m
memory: 200M
env:
- name: "DATA_SOURCE_URI"
value: "$(POD_NAME)/postgres?sslmode=require"
- name: "DATA_SOURCE_USER"
value: "$(POSTGRES_USER)"
- name: "DATA_SOURCE_PASS"
value: "$(POSTGRES_PASSWORD)"
- name: "PG_EXPORTER_AUTO_DISCOVER_DATABASES"
value: "true"
- name: PG_EXPORTER_CONSTANT_LABELS
value: 'release=$(CLUSTER_NAME),namespace=$(POD_NAMESPACE)'
- name: CLUSTER_NAME
valueFrom:
fieldRef:
apiVersion: v1
fieldPath: metadata.labels['cluster-name']
---
apiVersion: monitoring.coreos.com/v1
kind: PodMonitor
......
---
apiVersion: monitoring.coreos.com/v1
kind: PodMonitor
metadata:
name: postgresql
namespace: postgres-system
spec:
selector:
matchLabels:
application: spilo
podMetricsEndpoints:
- port: exporter
interval: 15s
scrapeTimeout: 10s
- targetPort: 8008
interval: 15s
scrapeTimeout: 10s
podTargetLabels:
- spilo-role
- cluster-name
- team
......@@ -21,5 +21,30 @@ spec:
upgrade:
crds: CreateReplace
values:
configGeneral:
sidecars:
- name: "exporter"
# renovate:
image: "quay.io/prometheuscommunity/postgres-exporter:v0.10.1"
ports:
- name: exporter
containerPort: 9187
protocol: TCP
resources:
limits:
cpu: 500m
memory: 256M
requests:
cpu: 100m
memory: 200M
env:
- name: "DATA_SOURCE_URI"
value: "$(POD_NAME)/postgres?sslmode=require"
- name: "DATA_SOURCE_USER"
value: "$(POSTGRES_USER)"
- name: "DATA_SOURCE_PASS"
value: "$(POSTGRES_PASSWORD)"
- name: "PG_EXPORTER_AUTO_DISCOVER_DATABASES"
value: "true"
configKubernetes:
enable_pod_antiaffinity: true
......@@ -11,5 +11,16 @@
"semanticCommits": "enabled",
"flux": {
"fileMatch": ["\\.yaml$"]
}
},
"regexManagers": [
{
"fileMatch": ["*.yaml$"],
"matchStrings": [
"# renovate:\\n\\s+image: \"?\'?(?<depName>[^:\\s]+?):(?<currentValue>[^\"]*?)\"?\'?\\s"
],
"datasourceTemplate": "docker",
"versioningTemplate": "docker"
}
],
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment