Skip to content

Commit 8ba57b2

Browse files
authored
extend RBAC in prepatation to switch to configmap-based cluster management (#2961)
1 parent dc29425 commit 8ba57b2

File tree

2 files changed

+31
-5
lines changed

2 files changed

+31
-5
lines changed

docs/reference/operator_parameters.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,8 +107,13 @@ Those are top-level keys, containing both leaf keys and groups.
107107
* **kubernetes_use_configmaps**
108108
Select if setup uses endpoints (default), or configmaps to manage leader when
109109
DCS is kubernetes (not etcd or similar). In OpenShift it is not possible to
110-
use endpoints option, and configmaps is required. By default,
111-
`kubernetes_use_configmaps: false`, meaning endpoints will be used.
110+
use endpoints option, and configmaps is required. Starting with K8s 1.33,
111+
endpoints are marked as deprecated. It's recommended to switch to config maps
112+
instead. But, to do so make sure you scale the Postgres cluster down to just
113+
one primary pod (e.g. using `max_instances` option). Otherwise, you risk
114+
running into a split-brain scenario.
115+
By default, `kubernetes_use_configmaps: false`, meaning endpoints will be used.
116+
Starting from v1.16.0 the default will be changed to `true`.
112117

113118
* **docker_image**
114119
Spilo Docker image for Postgres instances. For production, don't rely on the

manifests/operator-service-account-rbac.yaml

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,13 +59,20 @@ rules:
5959
- get
6060
- patch
6161
- update
62-
# to read configuration from ConfigMaps
62+
# to read configuration from ConfigMaps and help Patroni manage the cluster if endpoints are not used
6363
- apiGroups:
6464
- ""
6565
resources:
6666
- configmaps
6767
verbs:
68+
- create
69+
- delete
70+
- deletecollection
6871
- get
72+
- list
73+
- patch
74+
- update
75+
- watch
6976
# to send events to the CRs
7077
- apiGroups:
7178
- ""
@@ -78,7 +85,7 @@ rules:
7885
- patch
7986
- update
8087
- watch
81-
# to manage endpoints which are also used by Patroni
88+
# to manage endpoints which are also used by Patroni (if it is using config maps)
8289
- apiGroups:
8390
- ""
8491
resources:
@@ -249,7 +256,21 @@ kind: ClusterRole
249256
metadata:
250257
name: postgres-pod
251258
rules:
252-
# Patroni needs to watch and manage endpoints
259+
# Patroni needs to watch and manage config maps (or endpoints)
260+
- apiGroups:
261+
- ""
262+
resources:
263+
- configmaps
264+
verbs:
265+
- create
266+
- delete
267+
- deletecollection
268+
- get
269+
- list
270+
- patch
271+
- update
272+
- watch
273+
# Patroni needs to watch and manage endpoints (or config maps)
253274
- apiGroups:
254275
- ""
255276
resources:

0 commit comments

Comments
 (0)