mirror of
https://github.com/zalando/postgres-operator.git
synced 2026-10-05 19:22:30 +02:00
polish global config about sharing postgresql-run socket (#2155)
* polish global config about sharing postgresql-run socket
This commit is contained in:
@@ -344,7 +344,7 @@ configuration they are grouped under the `kubernetes` key.
|
||||
to run alongside Spilo on the same pod. Globally defined sidecars are always
|
||||
enabled. Default is true.
|
||||
|
||||
* **share_pg_socket_with_sidecars**
|
||||
* **share_pgsocket_with_sidecars**
|
||||
global option to create an emptyDir volume named `postgresql-run`. This is
|
||||
mounted by all containers at `/var/run/postgresql` sharing the unix socket of
|
||||
PostgreSQL (`pg_socket`) with the sidecars this way.
|
||||
|
||||
+33
-5
@@ -1008,11 +1008,39 @@ If you want to add a sidecar to every cluster managed by the operator, you can s
|
||||
|
||||
### Accessing the PostgreSQL socket from sidecars
|
||||
|
||||
If enabled by the `share_pg_socket_with_sidecars` option in the operator
|
||||
configuration the PostgreSQL socket is placed in a volume of type
|
||||
`emptyDir` named `postgresql-run`.
|
||||
To allow access to the socket from any sidecar container simply add a
|
||||
VolumeMount to this volume to your sidecar spec.
|
||||
If enabled by the `share_pgsocket_with_sidecars` option in the operator
|
||||
configuration the PostgreSQL socket is placed in a volume of type `emptyDir`
|
||||
named `postgresql-run`. To allow access to the socket from any sidecar
|
||||
container simply add a VolumeMount to this volume to your sidecar spec.
|
||||
|
||||
```yaml
|
||||
- name: "container-name"
|
||||
image: "company/image:tag"
|
||||
volumeMounts:
|
||||
- mountPath: /var/run
|
||||
name: postgresql-run
|
||||
```
|
||||
|
||||
If you do not want to globally enable this feature and only use it for single
|
||||
Postgres clusters, specify an `EmptyDir` volume under `additionalVolumes` in
|
||||
the manifest:
|
||||
|
||||
```yaml
|
||||
spec:
|
||||
additionalVolumes:
|
||||
- name: postgresql-run
|
||||
mountPath: /var/run/postgresql
|
||||
targetContainers:
|
||||
- all
|
||||
volumeSource:
|
||||
emptyDir: {}
|
||||
sidecars:
|
||||
- name: "container-name"
|
||||
image: "company/image:tag"
|
||||
volumeMounts:
|
||||
- mountPath: /var/run
|
||||
name: postgresql-run
|
||||
```
|
||||
|
||||
## InitContainers Support
|
||||
|
||||
|
||||
Reference in New Issue
Block a user