You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/administrator.md
+12Lines changed: 12 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -208,3 +208,15 @@ generated from the current cluster manifest. There are two types of scans: a
208
208
`sync scan`, running every `resync_period` seconds for every cluster, and the
209
209
`repair scan`, coming every `repair_period` only for those clusters that didn't
210
210
report success as a result of the last operation applied to them.
211
+
212
+
## Postgres roles supported by the operator
213
+
214
+
The operator is capable of maintaining roles of multiple kinds within a Postgres database cluster:
215
+
216
+
1. **System roles** are roles necessary for the proper work of Postgres itself such as a replication role or the initial superuser role. The operator delegates creating such roles to Patroni and only establishes relevant secrets.
217
+
218
+
2. **Infrastructure roles** are roles for processes originating from external systems, e.g. monitoring robots. The operator creates such roles in all PG clusters it manages assuming k8s secrets with the relevant credentials exist beforehand.
219
+
220
+
3. **Per-cluster robot users** are also roles for processes originating from external systems but defined for an individual Postgres cluster in its manifest. A typical example is a role for connections from an application that uses the database.
221
+
222
+
4. **Human users** originate from the Teams API that returns list of the team members given a team id. Operator differentiates between (a) product teams that own a particular Postgres cluster and are granted admin rights to maintain it, and (b) Postgres superuser teams that get the superuser access to all PG databases running in a k8s cluster for the purposes of maintaining and troubleshooting.
Copy file name to clipboardExpand all lines: docs/reference/operator_parameters.md
+3Lines changed: 3 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -377,6 +377,9 @@ key.
377
377
List of roles that cannot be overwritten by an application, team or
378
378
infrastructure role. The default is `admin`.
379
379
380
+
* **postgres_superuser_teams**
381
+
List of teams which members need the superuser role in each PG database cluster to administer Postgres and maintain infrastructure built around it. The default is `postgres_superuser`.
382
+
380
383
## Logging and REST API
381
384
382
385
Parameters affecting logging and REST API listener. In the CRD-based configuration they are grouped under the `logging_rest_api` key.
returnfmt.Errorf("Cannot create a team %q of Postgres superusers: %v", postgresSuperuserTeam, err)
774
+
}
775
+
ifpostgresSuperuserTeam==c.Spec.TeamID {
776
+
clusterIsOwnedBySuperuserTeam=true
777
+
}
778
+
}
779
+
780
+
ifclusterIsOwnedBySuperuserTeam {
781
+
c.logger.Infof("Team %q owning the cluster is also a team of superusers. Created superuser roles for its members instead of admin roles.", c.Spec.TeamID)
782
+
returnnil
783
+
}
784
+
785
+
err:=c.initTeamMembers(c.Spec.TeamID, false)
786
+
iferr!=nil {
787
+
returnfmt.Errorf("Cannot create a team %q of admins owning the PG cluster: %v", c.Spec.TeamID, err)
0 commit comments