Add config switch to share pg_socket in /var/run/postgresql via an emptyDir with the sidecar containers (#962)

This commit is contained in:
Christian Rohmann
2023-01-02 12:57:36 +01:00
committed by GitHub
parent a6a49fafc9
commit 024aab1f13
9 changed files with 58 additions and 1 deletions
+6
View File
@@ -344,6 +344,12 @@ 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**
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.
Default is `false`.
* **secret_name_template**
a template for the name of the database user secrets generated by the
operator. `{namespace}` is replaced with name of the namespace if
+9 -1
View File
@@ -1006,6 +1006,14 @@ option must be set to `true`.
If you want to add a sidecar to every cluster managed by the operator, you can specify it in the [operator configuration](administrator.md#sidecars-for-postgres-clusters) instead.
### 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.
## InitContainers Support
Each cluster can specify arbitrary init containers to run. These containers can
@@ -1049,7 +1057,7 @@ When using AWS with gp3 volumes you should set the mode to `mixed` because it
will also adjust the IOPS and throughput that can be defined in the manifest.
Check the [AWS docs](https://aws.amazon.com/ebs/general-purpose/) to learn
about default and maximum values. Keep in mind that AWS rate-limits updating
volume specs to no more than once every 6 hours.
volume specs to no more than once every 6 hours.
```yaml
spec: