Add PostgreSQL database backend option to OpenShift getting started guide - #8
Conversation
📝 WalkthroughWalkthroughAdds Kubernetes resources for a single-replica PostgreSQL 16 deployment with pgvector, persistent storage, credentials, and an internal service. Updates the OpenShift guide with SQLite and external PostgreSQL installation paths, provider configuration, verification steps, usage guidance, and troubleshooting details. Estimated code review effort: 3 (Moderate) | ~20 minutes 🚥 Pre-merge checks | ✅ 9 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (9 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 7
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@common/postgresql.yaml`:
- Around line 6-10: Remove the hard-coded PostgreSQL Secret data, including
POSTGRESQL_USER, POSTGRESQL_PASSWORD, POSTGRESQL_DATABASE, and uri, from
common/postgresql.yaml. In guides/getting-started-openshell-openshift.md,
replace the direct application of the credential-bearing manifest with
instructions to generate and provision the PostgreSQL credential through
protected Secret management.
- Around line 40-60: Add PostgreSQL readiness and startup probes using
pg_isready to the postgresql container in common/postgresql.yaml, configured
against the container’s database and credentials. Update
guides/getting-started-openshell-openshift.md lines 115-123 to wait for and
verify the pod’s Ready condition instead of treating Running as sufficient.
- Around line 65-75: The PostgreSQL Service currently has no network-level
ingress restriction. Add a Kubernetes NetworkPolicy for the PostgreSQL pods
selected by the Service’s app label, allowing ingress on TCP port 5432 only from
the verified gateway/app pod labels, while denying other ingress and preserving
the existing Service configuration.
- Around line 38-42: Harden the PostgreSQL pod defined by the postgresql
container securityContext by setting container-level allowPrivilegeEscalation to
false, dropping all Linux capabilities, and disabling automatic service account
token mounting. Preserve runAsNonRoot and apply the restricted-profile settings
at the appropriate pod/container scope so Checkov CKV_K8S_20 passes.
In `@guides/getting-started-openshell-openshift.md`:
- Around line 95-96: Replace the inline PostgreSQL URI in the kubectl command
with secure interactive secret creation: use a mode-0600 temporary file, read
the URI silently into DB_URI, write it to the file, create the Secret with
--from-file=uri, then unset DB_URI and remove the temporary file via an EXIT
trap. Include an exploit scenario describing exposure through shell history or
process inspection and retain the required remediation commands in the guide.
- Line 74: Remove server.auth.allowUnauthenticatedUsers=true from both
installation examples, including the occurrence near the referenced second
location, so the chart retains authenticated gateway access by default. Update
the OpenShift guidance to require explicit OIDC/UserIdentityProvider
authorization instead of unauthenticated Route access.
- Line 87: The external PostgreSQL manifest is not fully pinned. Update
guides/getting-started-openshell-openshift.md:87 to reference a reviewed
commit-SHA raw URL, replace the mutable quay.io/mcampbel/pgvector:pg16 image in
common/postgresql.yaml:42 with its reviewed digest, and pin or migrate any other
remote helper artifact referenced at
guides/getting-started-openshell-openshift.md:19.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Central YAML (base), Organization UI (inherited)
Review profile: CHILL
Plan: Pro Plus
Run ID: f1102138-81d6-4a2a-bd57-b2320a05555b
📒 Files selected for processing (2)
common/postgresql.yamlguides/getting-started-openshell-openshift.md
chtyler
left a comment
There was a problem hiding this comment.
Several issues noted with the diff changes.
Also, noticed numerous issues with the non-diffed changes that could be fixed in this PR, or in a separate PR.
ce874f7 to
80af83f
Compare
|
Hi @chtyler, thank you so much for the thorough review and advise. I've reviewed and addressed all comments, please have a look when you have a chance. Thank you! |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@guides/getting-started-openshell-openshift.md`:
- Line 124: Update the gateway pod verification guidance to replace the stale
“Namespace Setup” reference with the existing “Create the OpenShell namespace”
section, preserving the SCC troubleshooting context.
- Around line 85-91: Add an explicit warning immediately before the `oc apply`
command in the OpenShell PostgreSQL setup instructions, stating that the bundled
manifest is for isolated test clusters only, uses known credentials, and lacks
PostgreSQL TLS; require unique credentials and TLS via a managed PostgreSQL
service for shared or production clusters.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Central YAML (base), Organization UI (inherited)
Review profile: CHILL
Plan: Pro Plus
Run ID: ede9307e-2a25-4fa6-8981-c04f6d6a2596
📒 Files selected for processing (1)
guides/getting-started-openshell-openshift.md
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: chtyler, Ygnas The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Summary
common/postgresql.yamlmanifest for quickly deploying a test PostgreSQL instance on the cluster, with a note that production use cases should use a managed service. - These manifests had been created by @r3v5 :)urikey to the PostgreSQL credentials Secret so OpenShell can read the connection string directly without a second Secret.Jira: RHAIENG-6587
Test plan
common/postgresql.yamlmanifest and verify the gateway starts with PostgreSQL.helm get valuesshowsexternalDbSecretandworkload.kind=deploymentwhen using Option B.Summary by CodeRabbit
New Features
Documentation