-
Notifications
You must be signed in to change notification settings - Fork 36
/
pgpool-deploy-metrics.yaml
114 lines (114 loc) · 2.85 KB
/
pgpool-deploy-metrics.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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
apiVersion: apps/v1
kind: Deployment
metadata:
name: pgpool
spec:
replicas: 1
selector:
matchLabels:
app: pgpool
template:
metadata:
labels:
app: pgpool
spec:
containers:
- name: pgpool
image: pgpool/pgpool
env:
- name: POSTGRES_USERNAME
valueFrom:
secretKeyRef:
name: mypostgres-postgres-secret
key: username
- name: POSTGRES_PASSWORD
valueFrom:
secretKeyRef:
name: mypostgres-postgres-secret
key: password
- name: PGPOOL_PASSWORD_ENCRYPTION_METHOD
value: "scram-sha-256"
- name: PGPOOL_ENABLE_POOL_PASSWD
value: "true"
- name: PGPOOL_SKIP_PASSWORD_ENCRYPTION
value: "false"
# The following settings are not required when not using the Pgpool-II PCP command.
# To enable the following settings, you must define a secret that stores the PCP user's
# username and password.
#- name: PGPOOL_PCP_USER
# valueFrom:
# secretKeyRef:
# name: pgpool-pcp-secret
# key: username
#- name: PGPOOL_PCP_PASSWORD
# valueFrom:
# secretKeyRef:
# name: pgpool-pcp-secret
# key: password
volumeMounts:
- name: pgpool-config
mountPath: /config
#- name: pgpool-tls
# mountPath: /config/tls
- name: pgpool-stats
image: pgpool/pgpool2_exporter
env:
- name: POSTGRES_USERNAME
valueFrom:
secretKeyRef:
name: mypostgres-postgres-secret
key: username
- name: POSTGRES_PASSWORD
valueFrom:
secretKeyRef:
name: mypostgres-postgres-secret
key: password
- name: POSTGRES_DATABASE
value: "postgres"
- name: PGPOOL_SERVICE
value: "localhost"
- name: PGPOOL_SERVICE_PORT
value: "9999"
- name: SSLMODE
value: "require"
volumes:
- name: pgpool-config
configMap:
name: pgpool-config
# Configure your own TLS certificate.
# If not set, Pgpool-II will automatically generate the TLS certificate if ssl = on.
#- name: pgpool-tls
# secret:
# secretName: pgpool-tls
---
apiVersion: v1
kind: Service
metadata:
name: pgpool
spec:
selector:
app: pgpool
ports:
- name: pgpool-port
protocol: TCP
port: 9999
targetPort: 9999
---
apiVersion: v1
kind: Service
metadata:
name: pgpool-stats
labels:
app: pgpool-stats
annotations:
prometheus.io/path: /metrics
prometheus.io/port: "9719"
prometheus.io/scrape: "true"
spec:
selector:
app: pgpool
ports:
- name: pgpool-stats-port
protocol: TCP
port: 9719
targetPort: 9719