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: README.md
+10-3Lines changed: 10 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -85,17 +85,19 @@ metadata:
85
85
namespace: app
86
86
spec:
87
87
role: username
88
-
database: my-db # This references the Postgres CR
88
+
database: my-db # This references the Postgres CR
89
89
secretName: my-secret
90
-
privileges: OWNER # Can be OWNER/READ/WRITE
90
+
privileges: OWNER # Can be OWNER/READ/WRITE
91
+
annotations: # Annotations to be propagated to the secrets metadata section (optional)
92
+
foo: "bar"
91
93
```
92
94
93
95
This creates a user role `username-<hash>` and grants role `test-db-group`, `test-db-writer` or `test-db-reader` depending on `privileges` property. Its credentials are put in secret `my-secret-my-db-user`.
94
96
95
97
`PostgresUser`needs to reference a `Postgres` in the same namespace.
96
98
97
99
Two `Postgres` referencing the same database can exist in more than one namespace. The last CR referencing a database will drop the group role and transfer database ownership to the role used by the operator.
98
-
Every PostgresUser has a generated Kubernetes secret attached to it, which contains the following data (i.e.):
100
+
Every PostgresUser has a generated Kubernetes secret attached to it, which contains the following data (i.e.):
99
101
100
102
| Key | Comment |
101
103
|----------------------|---------------------|
@@ -107,6 +109,11 @@ Every PostgresUser has a generated Kubernetes secret attached to it, which conta
107
109
| `POSTGRES_URL` | Connection string for Posgres, could be used for Go applications |
With the help of annotations it is possible to create annotation-based copies of secrets in other namespaces.
115
+
116
+
For more information and an example, see [kubernetes-replicator#pull-based-replication](https://github.com/mittwald/kubernetes-replicator#pull-based-replication)
110
117
111
118
### Contribution
112
119
You can contribute to this project by opening a PR to merge to `master`, or one of the `vX.X.X` branches.
0 commit comments