Skip to content

Commit 3cb2677

Browse files
committed
Adds the 'crunchy-admin' container as a sidecar
container for all PG primary and replica pods. This administrative container is configured with an account called 'crunchyadm' that can authenticate into the database using peer authentication (specifically using a unix socket shared between both containers via an 'emptyDir' volume). This container allows administrative actions to be performed against the database using the 'crunchyadm' user, instead of relying on the superuser account.
1 parent 75ec46c commit 3cb2677

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed

conf/postgres-operator/cluster-deployment.json

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,9 @@
142142
}, {
143143
"mountPath": "/recover",
144144
"name": "recover-volume"
145+
}, {
146+
"mountPath": "/crunchyadm",
147+
"name": "crunchyadm"
145148
}
146149

147150
],
@@ -155,6 +158,38 @@
155158
}],
156159
"resources": {},
157160
"imagePullPolicy": "IfNotPresent"
161+
},
162+
{
163+
"name": "crunchyadm",
164+
"image": "{{.CCPImagePrefix}}/crunchy-admin:{{.CCPImageTag}}",
165+
"securityContext": {
166+
"runAsUser": 17
167+
},
168+
"readinessProbe": {
169+
"exec": {
170+
"command": [
171+
"/bin/bash",
172+
"-c",
173+
"[[ -f '/crunchyadm/pgha_initialized' ]]",
174+
"&& pg_isready -h /crunchyadm -U crunchyready"
175+
]
176+
},
177+
"initialDelaySeconds": 15,
178+
"timeoutSeconds": 8
179+
},
180+
"env": [
181+
{
182+
"name": "PGHOST",
183+
"value": "/crunchyadm"
184+
}
185+
],
186+
"volumeMounts": [
187+
{
188+
"mountPath": "/crunchyadm",
189+
"name": "crunchyadm"
190+
}
191+
],
192+
"imagePullPolicy": "IfNotPresent"
158193
}
159194

160195
{{.CollectAddon }}
@@ -201,6 +236,9 @@
201236
}, {
202237
"name": "backrestrepo",
203238
"emptyDir": { "medium": "Memory" }
239+
}, {
240+
"name": "crunchyadm",
241+
"emptyDir": {}
204242
}, {
205243
"name": "pgconf-volume",
206244
"projected": {

0 commit comments

Comments
 (0)