-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.yaml
140 lines (140 loc) · 3.51 KB
/
test.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
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
## This is test deployment for Kubernetes platforms.
## This is _not_ intended to be use in producction.
##
apiVersion: apps/v1
kind: Deployment
metadata:
name: test-pgpool
labels:
app.kubernetes.io/name: test-pgpool
app.kubernetes.io/component: pgpool
spec:
replicas: 1
selector:
matchLabels:
app.kubernetes.io/name: test-pgpool
app.kubernetes.io/component: pgpool
template:
metadata:
labels:
app.kubernetes.io/name: test-pgpool
app.kubernetes.io/component: pgpool
spec:
containers:
- image: bitnami/pgpool
name: pgpool
env:
- name: PGPOOL_BACKEND_NODES
value: "0:test-pgpool-backend-0:5432"
- name: PGPOOL_SR_CHECK_USER
value: "postgres"
- name: PGPOOL_SR_CHECK_PASSWORD
value: "adminpassword"
- name: PGPOOL_ENABLE_LDAP
value: "no"
- name: PGPOOL_USERNAME
values: "customuser"
- name: PGPOOL_PASSWORD
value: "custompassword"
ports:
- name: postgresql
containerPort: 5432
protocol: TCP
---
apiVersion: v1
kind: Service
metadata:
name: test-pgpool
labels:
app.kubernetes.io/name: test-pgpool
app.kubernetes.io/component: pgpool
spec:
ports:
- port: 5432
protocol: TCP
targetPort: postgresql
selector:
app.kubernetes.io/name: test-pgpool
app.kubernetes.io/component: pgpool
---
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: test-pgpool-backend
labels:
app.kubernetes.io/name: test-pgpool-backend
app.kubernetes.io/component: postgresql
spec:
serviceName: test-pgpool-backend-headless
replicas: 1
selector:
matchLabels:
app.kubernetes.io/name: test-pgpool-backend
app.kubernetes.io/component: postgresql
template:
metadata:
labels:
app.kubernetes.io/name: test-pgpool-backend
app.kubernetes.io/component: postgresql
spec:
containers:
- image: bitnami/postgresql-repmgr
name: postgresql-repmgr
env:
- name: POSTGRESQL_POSTGRES_PASSWORD
value: "adminpassword"
- name: POSTGRESQL_USERNAME
value: "customuser"
- name: POSTGRESQL_PASSWORD
value: "custompassword"
- name: POSTGRESQL_DATABASE
value: "customdatabase"
- name: REPMGR_PASSWORD
value: "repmgrpassword"
- name: REPMGR_PRIMARY_HOST
value: "test-pgpool-backend-0"
- name: REPMGR_NODE_NAME
value: "test-pgpool-backend-0"
- name: REPMGR_NODE_NETWORK_NAME
value: "test-pgpool-backend-0"
- name: REPMGR_PARTNER_NODES
value: "test-pgpool-backend-0"
ports:
- name: postgresql
containerPort: 5432
protocol: TCP
---
apiVersion: v1
kind: Service
metadata:
name: test-pgpool-backend
labels:
app.kubernetes.io/name: test-pgpool-backend
app.kubernetes.io/component: postgresql
spec:
type: ClusterIP
ports:
- port: 5432
protocol: TCP
targetPort: postgresql
selector:
app.kubernetes.io/name: test-pgpool-backend
app.kubernetes.io/component: postgresql
---
apiVersion: v1
kind: Service
metadata:
name: test-pgpool-backend--headless
labels:
app.kubernetes.io/name: test-pgpool-backend
app.kubernetes.io/component: postgresql
spec:
ClusterIP: None
type: ClusterIP
ports:
- port: 5432
protocol: TCP
targetPort: postgresql
selector:
app.kubernetes.io/name: test-pgpool-backend
app.kubernetes.io/component: postgresql