Skip to content

Commit 865d5b4

Browse files
authored
set event broadcasting to Infof and update rbac (#952)
1 parent d76203b commit 865d5b4

File tree

4 files changed

+26
-5
lines changed

4 files changed

+26
-5
lines changed

charts/postgres-operator/templates/clusterrole.yaml

+5
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,11 @@ rules:
4949
- events
5050
verbs:
5151
- create
52+
- get
53+
- list
54+
- patch
55+
- update
56+
- watch
5257
# to manage endpoints which are also used by Patroni
5358
- apiGroups:
5459
- ""

docs/user.md

+15-4
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,19 @@ them.
5353

5454
## Watch pods being created
5555

56+
Check if the database pods are coming up. Use the label `application=spilo` to
57+
filter and list the label `spilo-role` to see when the master is promoted and
58+
replicas get their labels.
59+
60+
```bash
61+
kubectl get pods -l application=spilo -L spilo-role -w
62+
```
63+
64+
The operator also emits K8s events to the Postgresql CRD which can be inspected
65+
in the operator logs or with:
66+
5667
```bash
57-
kubectl get pods -w --show-labels
68+
kubectl describe postgresql acid-minimal-cluster
5869
```
5970

6071
## Connect to PostgreSQL
@@ -736,14 +747,14 @@ spin up more instances).
736747

737748
## Custom TLS certificates
738749

739-
By default, the spilo image generates its own TLS certificate during startup.
750+
By default, the Spilo image generates its own TLS certificate during startup.
740751
However, this certificate cannot be verified and thus doesn't protect from
741752
active MITM attacks. In this section we show how to specify a custom TLS
742753
certificate which is mounted in the database pods via a K8s Secret.
743754

744755
Before applying these changes, in k8s the operator must also be configured with
745756
the `spilo_fsgroup` set to the GID matching the postgres user group. If you
746-
don't know the value, use `103` which is the GID from the default spilo image
757+
don't know the value, use `103` which is the GID from the default Spilo image
747758
(`spilo_fsgroup=103` in the cluster request spec).
748759

749760
OpenShift allocates the users and groups dynamically (based on scc), and their
@@ -805,5 +816,5 @@ spec:
805816
Alternatively, it is also possible to use
806817
[cert-manager](https://cert-manager.io/docs/) to generate these secrets.
807818

808-
Certificate rotation is handled in the spilo image which checks every 5
819+
Certificate rotation is handled in the Spilo image which checks every 5
809820
minutes if the certificates have changed and reloads postgres accordingly.

manifests/operator-service-account-rbac.yaml

+5
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,11 @@ rules:
5050
- events
5151
verbs:
5252
- create
53+
- get
54+
- list
55+
- patch
56+
- update
57+
- watch
5358
# to manage endpoints which are also used by Patroni
5459
- apiGroups:
5560
- ""

pkg/controller/controller.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ func NewController(controllerConfig *spec.ControllerConfig, controllerId string)
7676
}
7777

7878
eventBroadcaster := record.NewBroadcaster()
79-
eventBroadcaster.StartLogging(logger.Debugf)
79+
eventBroadcaster.StartLogging(logger.Infof)
8080
recorder := eventBroadcaster.NewRecorder(scheme.Scheme, v1.EventSource{Component: myComponentName})
8181

8282
c := &Controller{

0 commit comments

Comments
 (0)