Repository navigation
chore(ci): replace Crunchy Postgres operator with RHEL PostgreSQL StatefulSet - #5820
Conversation
|
@zdrapela: GitHub didn't allow me to request PR reviews from the following users: redhat-developer/rhdh-qe. Note that only redhat-developer members and repo collaborators can review this PR, and authors cannot review their own PRs. DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
|
/test e2e-ocp-helm |
|
/test e2e-ocp-v5-0-helm-nightly |
PR Summary by QodoReplace Crunchy PostgreSQL with a RHEL StatefulSet in OCP CI
AI Description
Diagram
High-Level Assessment
Files changed (20)
|
77549f7 to
5dbe654
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #5820 +/- ##
==========================================
- Coverage 78.97% 73.33% -5.65%
==========================================
Files 66 59 -7
Lines 723 570 -153
Branches 100 83 -17
==========================================
- Hits 571 418 -153
Misses 151 151
Partials 1 1
Continue to review full report in Codecov by Harness.
🚀 New features to boost your workflow:
|
|
/test e2e-ocp-helm |
|
The container image build workflow finished with status: |
|
/test e2e-ocp-v5-0-helm-nightly |
Code Review by Qodo 1. Existing database secrets block startup
|
|
/test e2e-ocp-v5-0-helm-nightly |
|
/agentic_review |
…tefulSet The Crunchy Postgres operator is not available in the OCP 5.0 certified-operators catalog (crunchy-postgres-operator is published for OCP 4.15-4.22 only), so every OCP job fails before the tests start. On top of that, Crunchy announced that the Developer Program images our PostgresCluster pulls will stop receiving updates on 2026-12-31. Deploy the external PostgreSQL used by showcase-rbac as a plain StatefulSet running registry.redhat.io/rhel9/postgresql-18 instead: - TLS server certificate generated by the CI script (CA + cert with SANs for the Service DNS names), served from the same postgress-external-db-cluster-cert secret the RBAC values mount. - The start hook restricts network connections to TLS and creates the janus-idp SUPERUSER from postgress-external-db-pguser-janus-idp. - The registry.redhat.io pull secret is created from the existing REGISTRY_REDHAT_IO_SERVICE_ACCOUNT_DOCKERCONFIGJSON CI secret. The Crunchy operator install, the PostgresCluster CRD waits and the OLM Subscription helpers (only used for Crunchy) are removed, together with the now empty cluster_setup_ocp_* hooks. Also rename the external DB TLS spec and update the CI docs accordingly. Jira: https://redhat.atlassian.net/browse/RHDHBUGS-4113 Assisted-by: OpenCode
- Replace the pg_hba.conf rewrite in the start hook with declarative pg_hba.rules loaded through hba_file, so TLS-only enforcement no longer depends on the authentication lines generated by the image - Set ssl_groups to prime256v1, since the PostgreSQL 18 default (X25519:prime256v1) is not FIPS-approved - Extract the certificates with oc extract and fail on empty passwords instead of publishing empty secrets - Propagate configure_external_postgres_db failures and drop the redundant StatefulSet wait in rbac_deployment - Drop the unused SCHEMA_MODE_EXTERNAL_DB_NAME override and refresh the CI docs, the pr-triage skill and the pgdb catalog entry Assisted-by: OpenCode
The janus-idp user name is a leftover from the Crunchy operator user spec and no longer describes the database used by CI. Rename the user and the secret that carries its credentials. Assisted-by: OpenCode
pg_hba trusted connections from 127.0.0.1 and ::1, so anything entering over loopback skipped both TLS and authentication. oc port-forward arrives over loopback, which means the showcase-rbac schema-mode discovery could reach the database in plaintext, contrary to the "requires TLS for every network connection" contract the docs and the RBAC values rely on. Keep the unix socket trusted for the image's start hooks and let every TCP client fall through to the hostssl scram-sha-256 rule. The readiness probe stays healthy: pg_isready counts a password request as "server up". Verified in podman with the unchanged start hook: plaintext loopback is rejected, TLS + password connects, the socket still authenticates, and check-container keeps returning 0. Also correct the docs the previous commits touched: the external PostgreSQL is deployed in Phase 4 with the RBAC instance, not during cluster setup; the operator job's schema tests use the operator-managed database, not the external one; and the cert secret comment no longer claims the operator CRs mount it. Assisted-by: OpenCode
1eb443f to
d6b9712
Compare
|
/test e2e-ocp-helm-nightly |
|
The container image build workflow finished with status: |
|
|
/agentic_review |
|
@rhdh-qodo-merge We're removing Crunchy from the CI completely. Can you re-evaluate your review with this in mind? |
|
Went through the PR and the bot comments — nothing blocking imo. The secret reuse issue can't really happen (namespaces are fresh each run), migration doesn't matter for test data, and the other two are nits at best since it's all ephemeral. /lgtm |
|
/cherry-pick release-2.1 |
|
@zdrapela: once the present PR merges, I will cherry-pick it on top of DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
6e6cd04
into
redhat-developer:main
|
@zdrapela: #5820 failed to apply on top of branch "release-2.1": DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |



Jira: https://redhat.atlassian.net/browse/RHDHBUGS-4113
The Crunchy Postgres operator is not in the OCP 5.0
certified-operatorscatalog, so the OCP jobs fail during cluster setup, and Crunchy's Developer Program images (used by ourPostgresCluster) stop receiving updates on 2026-12-31.This replaces the external PostgreSQL used by
showcase-rbacwith a plain StatefulSet runningregistry.redhat.io/rhel9/postgresql-18, keeping the Service names the RBAC values already expect, so the chart and test code stay unchanged:postgress-external-db-cluster-certsecret the RBAC values mount.pg_hba.rulesloaded throughhba_file: the unix socket is trusted for the image's start hooks, and every TCP client (includingoc port-forward, which arrives over loopback) needs TLS and a password.ssl_groupsis pinned toprime256v1for FIPS clusters.rhdhSUPERUSER frompostgress-external-db-pguser-rhdh, so role creation never depends on the image's authentication defaults.registry.redhat.iopull secret created from the existingREGISTRY_REDHAT_IO_SERVICE_ACCOUNT_DOCKERCONFIGJSONCI secret.PostgresClusterCRD waits, unused OLM Subscription helpers, emptycluster_setup_ocp_*hooks.janus-idp->rhdh) and updated the CI docs.Validated locally with podman, including an arbitrary UID run: plaintext loopback connections are rejected, TLS + password connects,
rhdhis a superuser, the readiness probe reports healthy with the TLS-only rules, and the data dir is on the PVC.