-
Notifications
You must be signed in to change notification settings - Fork 2
/
mission-control-configs.yaml
76 lines (74 loc) · 2.27 KB
/
mission-control-configs.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
apiVersion: configs.flanksource.com/v1
kind: ScrapeConfig
metadata:
name: mission-control-files
spec:
sql:
- connection: "postgres://$(username):$(password)@postgres:5432/incident_commander?sslmode=disable"
name: pg_settings
tags:
chart: mission-control
type: "Postgres"
id: "incident_commander"
auth:
username:
valueFrom:
secretKeyRef:
key: POSTGRES_USER
name: incident-commander-postgres
password:
valueFrom:
secretKeyRef:
key: POSTGRES_PASSWORD
name: incident-commander-postgres
items: .database
query: |
WITH settings AS (
select json_object_agg(name, concat(setting,unit)) as setting from pg_settings where source != 'default'
),
roles as (
SELECT json_object_agg(usename,
CASE
WHEN usesuper AND usecreatedb THEN
CAST('superuser, create database' AS pg_catalog.text)
WHEN usesuper THEN
CAST('superuser' AS pg_catalog.text)
WHEN usecreatedb THEN
CAST('create database' AS pg_catalog.text)
ELSE
CAST('' AS pg_catalog.text)
END) as role
FROM pg_catalog.pg_user
)
select json_build_object('version', version(), 'settings', s.setting, 'roles', r.role ) as database FROM (SELECT * from settings) as s, (Select * from roles) as r
results: 1
kubernetesFile:
- tags:
chart: mission-control
selector:
namespace: demo
kind: Statefulset
name: postgresql
files:
- path:
- /var/lib/postgresql/data/pgdata/postgresql.conf
- /var/lib/postgresql/data/pgdata/pg_hba.conf
- /var/lib/postgresql/data/pgdata/pg_ident.conf
format: properties
- tags:
chart: mission-control
app: kratos
selector:
namespace: demo
kind: Deployment
name: kratos
files:
- path:
- /etc/config/kratos.yaml
format: yaml
transform:
mask:
- selector:
type: File
jsonpath: $.courier.smtp.connection_uri
value: md5sum