@@ -109,7 +109,11 @@ These parameters are grouped directly under the `spec` key in the manifest.
109109 ` SUPERUSER ` , ` REPLICATION ` , ` INHERIT ` , ` LOGIN ` , ` NOLOGIN ` , ` CREATEROLE ` ,
110110 ` CREATEDB ` , ` BYPASSURL ` . A login user is created by default unless NOLOGIN is
111111 specified, in which case the operator creates a role. One can specify empty
112- flags by providing a JSON empty array '* [ ] * '. Optional.
112+ flags by providing a JSON empty array '* [ ] * '. If the config option
113+ ` enable_cross_namespace_secrets ` is enabled you can specify the namespace in
114+ the user name in the form ` {namespace}.{username} ` and the operator will
115+ create the K8s secret in that namespace. The part after the first ` . ` is
116+ considered to be the user name. Optional.
113117
114118* ** databases**
115119 a map of database names to database owners for the databases that should be
@@ -185,6 +189,35 @@ These parameters are grouped directly under the `spec` key in the manifest.
185189 If you set the ` all ` special item, it will be mounted in all containers (postgres + sidecars).
186190 Else you can set the list of target containers in which the additional volumes will be mounted (eg : postgres, telegraf)
187191
192+ ## Prepared Databases
193+
194+ The operator can create databases with default owner, reader and writer roles
195+ without the need to specifiy them under ` users ` or ` databases ` sections. Those
196+ parameters are grouped under the ` preparedDatabases ` top-level key. For more
197+ information, see [ user docs] ( ../user.md#prepared-databases-with-roles-and-default-privileges ) .
198+
199+ * ** defaultUsers**
200+ The operator will always create default ` NOLOGIN ` roles for defined prepared
201+ databases, but if ` defaultUsers ` is set to ` true ` three additional ` LOGIN `
202+ roles with ` _user ` suffix will get created. Default is ` false ` .
203+
204+ * ** extensions**
205+ map of extensions with target database schema that the operator will install
206+ in the database. Optional.
207+
208+ * ** schemas**
209+ map of schemas that the operator will create. Optional - if no schema is
210+ listed, the operator will create a schema called ` data ` . Under each schema
211+ key, it can be defined if ` defaultRoles ` (NOLOGIN) and ` defaultUsers ` (LOGIN)
212+ roles shall be created that have schema-exclusive privileges. Both flags are
213+ set to ` false ` by default.
214+
215+ * ** secretNamespace**
216+ for each default LOGIN role the operator will create a secret. You can
217+ specify the namespace in which these secrets will get created, if
218+ ` enable_cross_namespace_secrets ` is set to ` true ` in the config. Otherwise,
219+ the cluster namespace is used.
220+
188221## Postgres parameters
189222
190223Those parameters are grouped under the ` postgresql ` top-level key, which is
@@ -258,31 +291,33 @@ explanation of `ttl` and `loop_wait` parameters.
258291
259292Those parameters define [ CPU and memory requests and limits] ( https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/ )
260293for the Postgres container. They are grouped under the ` resources ` top-level
261- key with subgroups ` requests ` and ` limits ` .
294+ key with subgroups ` requests ` and ` limits ` . The whole section is optional,
295+ however if you specify a request or limit you have to define everything
296+ (unless you are not modifying the default CRD schema validation).
262297
263298### Requests
264299
265300CPU and memory requests for the Postgres container.
266301
267302* ** cpu**
268303 CPU requests for the Postgres container. Optional, overrides the
269- ` default_cpu_requests ` operator configuration parameter. Optional.
304+ ` default_cpu_requests ` operator configuration parameter.
270305
271306* ** memory**
272307 memory requests for the Postgres container. Optional, overrides the
273- ` default_memory_request ` operator configuration parameter. Optional.
308+ ` default_memory_request ` operator configuration parameter.
274309
275310### Limits
276311
277312CPU and memory limits for the Postgres container.
278313
279314* ** cpu**
280315 CPU limits for the Postgres container. Optional, overrides the
281- ` default_cpu_limits ` operator configuration parameter. Optional.
316+ ` default_cpu_limits ` operator configuration parameter.
282317
283318* ** memory**
284319 memory limits for the Postgres container. Optional, overrides the
285- ` default_memory_limits ` operator configuration parameter. Optional.
320+ ` default_memory_limits ` operator configuration parameter.
286321
287322## Parameters defining how to clone the cluster from another one
288323
0 commit comments