Skip to content

Commit 3c6cba6

Browse files
authored
Improve README.md and the release.yml workflow (#13)
* improve README.md and the release.yml workflow * add a section describing on how to generated the pg_catalog jOOQ sources * add declarative management section to the README.md * improve wording * fix the release.yml workflow * fix company name in file LICENSE * lowercase the URLs * Revert "fix company name in file LICENSE" This reverts commit 5a639a7.
1 parent 70231be commit 3c6cba6

File tree

2 files changed

+69
-2
lines changed

2 files changed

+69
-2
lines changed

.github/workflows/release.yml

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,7 @@ jobs:
4747
env:
4848
GITHUB_USER_NAME: ${{ github.actor }}
4949
GITHUB_ACCESS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
50-
- name: Build Docker image
51-
uses: aboutbits/github-actions-docker/build-push@v1
50+
- uses: aboutbits/github-actions-docker/build-push@v1
5251
with:
5352
username: ${{ github.actor }}
5453
password: ${{ secrets.GITHUB_TOKEN }}
@@ -70,6 +69,9 @@ jobs:
7069
helm install postgresql-operator https://github.com/${{ github.repository }}/releases/download/v${{ steps.nextVersion.outputs.version }}/postgresql-operator-${{ steps.nextVersion.outputs.version }}.tgz
7170
```
7271
72+
With the Helm chart, the Custom Resource Definitions (CRDs) are installed automatically.
73+
However, if you deploy the operator directly from the OCI image, the CRDs are not automatically applied and must be installed separately.
74+
7375
### Manual CRD Installation
7476
```bash
7577
kubectl apply -f https://github.com/${{ github.repository }}/releases/download/v${{ steps.nextVersion.outputs.version }}/clusterconnections.postgresql.aboutbits.it-v1.yml
@@ -86,3 +88,10 @@ jobs:
8688
run: |
8789
gh release upload v${{ steps.nextVersion.outputs.version }} operator/build/helm/kubernetes/*.tgz operator/build/kubernetes/*.postgresql.aboutbits.it-v1.yml
8890
shell: bash
91+
- name: Update README.md
92+
run: |
93+
sed -i "s|releases/download/v[0-9.]*/postgresql-operator-[0-9.]*.tgz|releases/download/v${{ steps.nextVersion.outputs.version }}/postgresql-operator-${{ steps.nextVersion.outputs.version }}.tgz|g" README.md
94+
git add README.md
95+
git diff-index --quiet HEAD || git commit -m "update README.md with version ${{ steps.nextVersion.outputs.version }}"
96+
git push
97+
shell: bash

README.md

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,18 @@ AboutBits PostgreSQL Operator is a Kubernetes operator that helps you manage Pos
3131
└──────────────────────────────────────────────────────────────────────────┘
3232
```
3333

34+
## Installation
35+
36+
### Helm Chart
37+
38+
```bash
39+
helm install postgresql-operator https://github.com/aboutbits/postgresql-operator/releases/download/v0.1.1/postgresql-operator-0.1.1.tgz
40+
```
41+
42+
With the Helm chart, the Custom Resource Definitions (CRDs) are installed automatically.
43+
However, if you deploy the operator directly from the OCI image, the CRDs are not automatically applied and must be installed separately.
44+
See the release notes for the [latest version](https://github.com/aboutbits/postgresql-operator/releases/latest) for more information.
45+
3446
## Usage
3547

3648
This operator allows you to manage PostgreSQL resources using Kubernetes manifests.
@@ -43,6 +55,30 @@ Further documentation of each Custom Resource can be found here:
4355
- [Grant](docs/grant.md) - Manage privileges.
4456
- [DefaultPrivilege](docs/default-privilege.md) - Manage default privileges.
4557

58+
### Declarative Management
59+
60+
The Operator leverages the power of Kubernetes Custom Resource Definitions (CRDs) to manage PostgreSQL resources declaratively.
61+
This means the Operator continuously reconciles the state of the cluster to match your desired state defined in the CRs.
62+
63+
**Updates**
64+
65+
If you modify a mutable field in a Custom Resource, the Operator automatically applies these changes to the PostgreSQL cluster.
66+
The operator, for example, handles:
67+
68+
- Changing a `Role`'s flags, password, or comment.
69+
- Updating the `Role` password if the password in the referenced Secret changes.
70+
- Updating `Grant`/`DefaultPrivilege` objects or privileges.
71+
- Changing a `Schema` or `Database` owner.
72+
73+
**Deletions**
74+
75+
Deleting a Custom Resource triggers the cleanup of the corresponding PostgreSQL object:
76+
77+
- For `Grant`, `DefaultPrivilege`, and `Role` resources, the operator revokes privileges or drops the role.
78+
- For `Database` and `Schema` resources, the behavior depends on the `reclaimPolicy` (defaults to `Retain` to prevent accidental data loss).
79+
80+
This ensures that your PostgreSQL cluster configuration always reflects your Kubernetes manifests, simplifying management and automation.
81+
4682
### Showcase
4783

4884
The following example shows how to set up a connection to a PostgreSQL cluster, create a database and schema, a login role (user), and configure permissions.
@@ -212,6 +248,28 @@ make test
212248

213249
Afterward, the project can be started in IntelliJ by navigating to `Run` -> `Run '...'`.
214250

251+
#### Generating jOOQ sources
252+
253+
To update the generated jOOQ sources from schema `pg_catalog`, you need to run the application in dev mode first to start the PostgreSQL Dev Service:
254+
255+
```bash
256+
make run
257+
258+
# or
259+
260+
./gradlew :operator:quarkusDev
261+
```
262+
263+
Once the application is running (and the database is available on port 5432), run the following command:
264+
265+
```bash
266+
make generate-jooq
267+
268+
# or
269+
270+
./gradlew :generated:jooqCodegen
271+
```
272+
215273
### Docker Environment
216274

217275
See [Docker Environment](docs/docker-environment.md) for setting up a local development environment using Quarkus Dev Services.

0 commit comments

Comments
 (0)