Skip to content

Commit 1efb34c

Browse files
author
Steve Boardwell
committed
Add annotations info to README
1 parent 21256f0 commit 1efb34c

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

README.md

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,17 +85,19 @@ metadata:
8585
namespace: app
8686
spec:
8787
role: username
88-
database: my-db # This references the Postgres CR
88+
database: my-db # This references the Postgres CR
8989
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"
9193
```
9294

9395
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`.
9496

9597
`PostgresUser` needs to reference a `Postgres` in the same namespace.
9698

9799
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.):
99101

100102
| Key | Comment |
101103
|----------------------|---------------------|
@@ -107,6 +109,11 @@ Every PostgresUser has a generated Kubernetes secret attached to it, which conta
107109
| `POSTGRES_URL` | Connection string for Posgres, could be used for Go applications |
108110
| `POSTGRES_JDBC_URL` | JDBC compatible Postgres URI, formatter as `jdbc:postgresql://{POSTGRES_HOST}/{DATABASE_NAME}` |
109111

112+
#### Annotations Use Case
113+
114+
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)
110117

111118
### Contribution
112119
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

Comments
 (0)