From 2136b887067906f4fff29d10771d55f2d8cb9f1f Mon Sep 17 00:00:00 2001 From: Thomas Sapelza Date: Thu, 29 Jan 2026 10:34:11 +0100 Subject: [PATCH 1/8] improve README.md and the release.yml workflow --- .github/workflows/release.yml | 14 +++++++++++++- README.md | 12 ++++++++++++ 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 54f3650..54ad25f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -59,7 +59,8 @@ jobs: - name: Push tag to remote run: ./gradlew --console=colored pushRelease shell: bash - - uses: aboutbits/github-actions-base/github-create-release@v2 + - name: Create GitHub Release + uses: aboutbits/github-actions-base/github-create-release@v2 with: tag-name: 'v${{ steps.nextVersion.outputs.version }}' release-description: | @@ -70,6 +71,9 @@ jobs: helm install postgresql-operator https://github.com/${{ github.repository }}/releases/download/v${{ steps.nextVersion.outputs.version }}/postgresql-operator-${{ steps.nextVersion.outputs.version }}.tgz ``` + With the Helm chart, the Custom Resource Definitions (CRDs) are installed automatically. + However, if you deploy the operator directly from the OCI image, the CRDs are not automatically applied and must be installed separately. + ### Manual CRD Installation ```bash kubectl apply -f https://github.com/${{ github.repository }}/releases/download/v${{ steps.nextVersion.outputs.version }}/clusterconnections.postgresql.aboutbits.it-v1.yml @@ -86,3 +90,11 @@ jobs: run: | gh release upload v${{ steps.nextVersion.outputs.version }} operator/build/helm/kubernetes/*.tgz operator/build/kubernetes/*.postgresql.aboutbits.it-v1.yml shell: bash + - name: Update README.md + run: | + 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 + git add README.md + # Guard against failing if there are no changes + git diff-index --quiet HEAD || git commit -m "Update README.md with version ${{ steps.nextVersion.outputs.version }}" + git push + shell: bash diff --git a/README.md b/README.md index ff182fa..3a296b9 100644 --- a/README.md +++ b/README.md @@ -31,6 +31,18 @@ AboutBits PostgreSQL Operator is a Kubernetes operator that helps you manage Pos └──────────────────────────────────────────────────────────────────────────┘ ``` +## Installation + +### Helm Chart + +```bash +helm install postgresql-operator https://github.com/AboutBits/postgresql-operator/releases/download/v0.1.1/postgresql-operator-0.1.1.tgz +``` + +With the Helm chart, the Custom Resource Definitions (CRDs) are installed automatically. +However, if you deploy the operator directly from the OCI image, the CRDs are not automatically applied and must be installed separately. +See the release notes for the [latest version](https://github.com/AboutBits/postgresql-operator/releases/latest) for more information. + ## Usage This operator allows you to manage PostgreSQL resources using Kubernetes manifests. From 893d71645460ecb2d7bb26a9818f4b10ea4b3e1f Mon Sep 17 00:00:00 2001 From: Thomas Sapelza Date: Thu, 29 Jan 2026 10:43:01 +0100 Subject: [PATCH 2/8] add a section describing on how to generated the pg_catalog jOOQ sources --- README.md | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/README.md b/README.md index 3a296b9..343d354 100644 --- a/README.md +++ b/README.md @@ -224,6 +224,28 @@ make test Afterward, the project can be started in IntelliJ by navigating to `Run` -> `Run '...'`. +#### Generating jOOQ sources + +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: + +```bash +make run + +# or + +./gradlew :operator:quarkusDev +``` + +Once the application is running (and the database is available on port 5432), run the following command: + +```bash +make generate-jooq + +# or + +./gradlew :generated:jooqCodegen +``` + ### Docker Environment See [Docker Environment](docs/docker-environment.md) for setting up a local development environment using Quarkus Dev Services. From 24925b2a7b7eb749f57ecf8f32b6e41d4e337268 Mon Sep 17 00:00:00 2001 From: Thomas Sapelza Date: Thu, 29 Jan 2026 10:51:31 +0100 Subject: [PATCH 3/8] add declarative management section to the README.md --- README.md | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/README.md b/README.md index 343d354..99631ea 100644 --- a/README.md +++ b/README.md @@ -55,6 +55,29 @@ Further documentation of each Custom Resource can be found here: - [Grant](docs/grant.md) - Manage privileges. - [DefaultPrivilege](docs/default-privilege.md) - Manage default privileges. +### Declarative Management + +The Operator leverages the power of Kubernetes Custom Resource Definitions (CRDs) to manage PostgreSQL resources declaratively. +This means the Operator continuously reconciles the state of the cluster to match your desired state defined in the CRs. + +**Updates** + +If you modify a mutable field in a Custom Resource, the Operator automatically applies these changes to the PostgreSQL cluster. This includes: + +- Changing a `Role` flags, password or comment. +- Updating `Grant` objects or privileges. +- Changing a `Schema` or `Database` owner. +- Updating the `Role` password if the password in the referenced Secret changes. + +**Deletions** + +Deleting a Custom Resource triggers the cleanup of the corresponding PostgreSQL object: + +- For `Grant`, `DefaultPrivilege`, and `Role` resources, the operator revokes privileges or drops the role. +- For `Database` and `Schema` resources, the behavior depends on the `reclaimPolicy` (defaulting to `Retain` to prevent accidental data loss). + +This ensures that your PostgreSQL cluster configuration always reflects your Kubernetes manifests, simplifying management and automation. + ### Showcase 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. From 472f9cf795adb724df2bd6f268e0503925d3f7db Mon Sep 17 00:00:00 2001 From: Thomas Sapelza Date: Thu, 29 Jan 2026 11:04:27 +0100 Subject: [PATCH 4/8] improve wording --- README.md | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 99631ea..a358ab4 100644 --- a/README.md +++ b/README.md @@ -62,19 +62,20 @@ This means the Operator continuously reconciles the state of the cluster to matc **Updates** -If you modify a mutable field in a Custom Resource, the Operator automatically applies these changes to the PostgreSQL cluster. This includes: +If you modify a mutable field in a Custom Resource, the Operator automatically applies these changes to the PostgreSQL cluster. +The operator, for example, handles: -- Changing a `Role` flags, password or comment. -- Updating `Grant` objects or privileges. -- Changing a `Schema` or `Database` owner. +- Changing a `Role`'s flags, password, or comment. - Updating the `Role` password if the password in the referenced Secret changes. +- Updating `Grant`/`DefaultPrivilege` objects or privileges. +- Changing a `Schema` or `Database` owner. **Deletions** Deleting a Custom Resource triggers the cleanup of the corresponding PostgreSQL object: - For `Grant`, `DefaultPrivilege`, and `Role` resources, the operator revokes privileges or drops the role. -- For `Database` and `Schema` resources, the behavior depends on the `reclaimPolicy` (defaulting to `Retain` to prevent accidental data loss). +- For `Database` and `Schema` resources, the behavior depends on the `reclaimPolicy` (defaults to `Retain` to prevent accidental data loss). This ensures that your PostgreSQL cluster configuration always reflects your Kubernetes manifests, simplifying management and automation. From e463771df618eccb79fc85ec037582e1adbe02a2 Mon Sep 17 00:00:00 2001 From: Thomas Sapelza Date: Thu, 29 Jan 2026 11:34:28 +0100 Subject: [PATCH 5/8] fix the release.yml workflow --- .github/workflows/release.yml | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 54ad25f..ef5b439 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -47,8 +47,7 @@ jobs: env: GITHUB_USER_NAME: ${{ github.actor }} GITHUB_ACCESS_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - name: Build Docker image - uses: aboutbits/github-actions-docker/build-push@v1 + - uses: aboutbits/github-actions-docker/build-push@v1 with: username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} @@ -59,8 +58,7 @@ jobs: - name: Push tag to remote run: ./gradlew --console=colored pushRelease shell: bash - - name: Create GitHub Release - uses: aboutbits/github-actions-base/github-create-release@v2 + - uses: aboutbits/github-actions-base/github-create-release@v2 with: tag-name: 'v${{ steps.nextVersion.outputs.version }}' release-description: | @@ -94,7 +92,6 @@ jobs: run: | 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 git add README.md - # Guard against failing if there are no changes - git diff-index --quiet HEAD || git commit -m "Update README.md with version ${{ steps.nextVersion.outputs.version }}" + git diff-index --quiet HEAD || git commit -m "update README.md with version ${{ steps.nextVersion.outputs.version }}" git push shell: bash From 5a639a7cbdbc6e5386b918c4ca17037b68012fd3 Mon Sep 17 00:00:00 2001 From: Thomas Sapelza Date: Thu, 29 Jan 2026 11:34:58 +0100 Subject: [PATCH 6/8] fix company name in file LICENSE --- LICENSE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LICENSE b/LICENSE index 21586f5..06d70fb 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,4 @@ -Copyright About Bits GmbH +Copyright AboutBits GmbH Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: From 8aab37a4f098fca438b19bec6f2282663808d424 Mon Sep 17 00:00:00 2001 From: Thomas Sapelza Date: Thu, 29 Jan 2026 11:38:49 +0100 Subject: [PATCH 7/8] lowercase the URLs --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index a358ab4..4335ffa 100644 --- a/README.md +++ b/README.md @@ -36,12 +36,12 @@ AboutBits PostgreSQL Operator is a Kubernetes operator that helps you manage Pos ### Helm Chart ```bash -helm install postgresql-operator https://github.com/AboutBits/postgresql-operator/releases/download/v0.1.1/postgresql-operator-0.1.1.tgz +helm install postgresql-operator https://github.com/aboutbits/postgresql-operator/releases/download/v0.1.1/postgresql-operator-0.1.1.tgz ``` With the Helm chart, the Custom Resource Definitions (CRDs) are installed automatically. However, if you deploy the operator directly from the OCI image, the CRDs are not automatically applied and must be installed separately. -See the release notes for the [latest version](https://github.com/AboutBits/postgresql-operator/releases/latest) for more information. +See the release notes for the [latest version](https://github.com/aboutbits/postgresql-operator/releases/latest) for more information. ## Usage From 128f7f925a151ab7cb5e73f04fa5a0b2576093a0 Mon Sep 17 00:00:00 2001 From: Thomas Sapelza Date: Thu, 29 Jan 2026 11:41:28 +0100 Subject: [PATCH 8/8] Revert "fix company name in file LICENSE" This reverts commit 5a639a7cbdbc6e5386b918c4ca17037b68012fd3. --- LICENSE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LICENSE b/LICENSE index 06d70fb..21586f5 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,4 @@ -Copyright AboutBits GmbH +Copyright About Bits GmbH Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: