Skip to content

Commit bc38f98

Browse files
committed
Add docs and fix samples
1 parent 64f953f commit bc38f98

File tree

2 files changed

+34
-1
lines changed

2 files changed

+34
-1
lines changed

docs/administrator.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -706,6 +706,35 @@ data:
706706
The key-value pairs of the Secret are all accessible as environment variables
707707
to the Postgres StatefulSet/pods.
708708

709+
### For individual cluster
710+
711+
It is possible to set environment variables in the Spilo pods directly as parameters or
712+
as a link to secrets for each individual cluster, in addition to or instead of the
713+
global parameters given in the examples above.
714+
715+
In order to do this, you need to configure the cluster parameters, as in the example below
716+
717+
```yaml
718+
apiVersion: "acid.zalan.do/v1"
719+
kind: postgresql
720+
metadata:
721+
name: acid-test-cluster
722+
spec:
723+
env:
724+
- name: wal_s3_bucket
725+
value: my-custom-bucket
726+
- name: minio_secret_key
727+
valueFrom:
728+
secretKeyRef:
729+
name: my-custom-secret
730+
key: minio_secret_key
731+
```
732+
733+
If global parameters are set at the level of the entire controller in the form of
734+
a ConfigMap or a Secret, then the individual cluster parameters will have a higher
735+
priority and the same keys will be overridden, and different ones will be merged into
736+
a single array of environment variable parameter values.
737+
709738
## Limiting the number of min and max instances in clusters
710739

711740
As a preventive measure, one can restrict the minimum and the maximum number of

manifests/complete-postgres-manifest.yaml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,10 @@ spec:
4949
shared_buffers: "32MB"
5050
max_connections: "10"
5151
log_statement: "all"
52+
# env:
53+
# - name: wal_s3_bucket
54+
# value: my-custom-bucket
55+
5256
volume:
5357
size: 1Gi
5458
# storageClass: my-sc
@@ -120,7 +124,7 @@ spec:
120124
# database: foo
121125
# plugin: pgoutput
122126
ttl: 30
123-
loop_wait: &loop_wait 10
127+
loop_wait: 10
124128
retry_timeout: 10
125129
synchronous_mode: false
126130
synchronous_mode_strict: false

0 commit comments

Comments
 (0)