refactor(doclet): migrate postgres and nats components to resources - #46
refactor(doclet): migrate postgres and nats components to resources#46kavix wants to merge 1 commit into
Conversation
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📝 WalkthroughWalkthroughMigrates doclet NATS and Postgres to managed resources with resource release bindings, rewires dependent workloads to the resources model, removes the old component-based manifests, and updates GitOps repository URLs in Flux and workflow templates. ChangesDoclet resource migration
GitOps repository URL updates
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related issues
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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: 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 `@namespaces/default/projects/doclet/bindings/development/nats.yaml`:
- Around line 12-16: The shared development NATS binding currently enables the
unauthenticated admin `/varz` endpoint via
resourceTypeEnvironmentConfigs.adminEnabled, which should not be on by default.
Update this binding to keep adminEnabled disabled here and move any demo-only
exposure into a separate demo overlay or equivalent demo-specific config, using
the existing resourceTypeEnvironmentConfigs block as the place to adjust the
setting.
In `@namespaces/default/projects/doclet/bindings/development/postgres.yaml`:
- Around line 12-15: The development Postgres config currently enables the
gateway-exposed Adminer demo superuser, which should not be shipped in this
environment. Update the resourceTypeEnvironmentConfigs in postgres.yaml so
adminEnabled is disabled by default for development, and only allow it behind an
explicit, narrowly scoped opt-in if needed. Use the adminEnabled setting as the
main symbol to locate and change this behavior.
🪄 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: defaults
Review profile: CHILL
Plan: Pro
Run ID: 5ac2465f-3c8e-4bf1-85cf-3e2e6cd58086
📒 Files selected for processing (16)
namespaces/default/projects/doclet/bindings/development/nats.yamlnamespaces/default/projects/doclet/bindings/development/postgres.yamlnamespaces/default/projects/doclet/components/collab-svc/workload.yamlnamespaces/default/projects/doclet/components/document-svc/workload.yamlnamespaces/default/projects/doclet/components/nats/component.yamlnamespaces/default/projects/doclet/components/nats/release-bindings/nats-development.yamlnamespaces/default/projects/doclet/components/nats/release-bindings/nats-staging.yamlnamespaces/default/projects/doclet/components/nats/releases/nats-20260223-1.yamlnamespaces/default/projects/doclet/components/nats/workload.yamlnamespaces/default/projects/doclet/components/postgres/component.yamlnamespaces/default/projects/doclet/components/postgres/release-bindings/postgres-development.yamlnamespaces/default/projects/doclet/components/postgres/release-bindings/postgres-staging.yamlnamespaces/default/projects/doclet/components/postgres/releases/postgres-20260223-1.yamlnamespaces/default/projects/doclet/components/postgres/workload.yamlnamespaces/default/projects/doclet/resources/nats.yamlnamespaces/default/projects/doclet/resources/postgres.yaml
💤 Files with no reviewable changes (10)
- namespaces/default/projects/doclet/components/postgres/release-bindings/postgres-staging.yaml
- namespaces/default/projects/doclet/components/nats/release-bindings/nats-staging.yaml
- namespaces/default/projects/doclet/components/nats/component.yaml
- namespaces/default/projects/doclet/components/postgres/component.yaml
- namespaces/default/projects/doclet/components/postgres/release-bindings/postgres-development.yaml
- namespaces/default/projects/doclet/components/postgres/releases/postgres-20260223-1.yaml
- namespaces/default/projects/doclet/components/nats/workload.yaml
- namespaces/default/projects/doclet/components/nats/release-bindings/nats-development.yaml
- namespaces/default/projects/doclet/components/postgres/workload.yaml
- namespaces/default/projects/doclet/components/nats/releases/nats-20260223-1.yaml
c8ccd87 to
6b547c2
Compare
|
@kavix Thanks for your contribution. Did you verify the full setup after this change? if not can you please follow the guide in https://openchoreo.dev/docs/next/platform-engineer-guide/gitops/using-flux-cd/#tutorial and verify the full setup with your changes? |
711184d to
6b547c2
Compare
Thanks for the feedback. I verified the setup by following the Flux CD guide and comparing it with the upstream Doclet sample. The manifests applied successfully. After Flux synced the changes, I promoted the Postgres and NATS resources using the required I also confirmed that staging resources follow the existing bulk GitOps promotion workflow. The admin UIs are disabled by default in development for security, and the hardcoded database credentials were removed. I have added the verification and promotion details to the PR description. Please let me know if any additional checks are needed. |
Signed-off-by: Kavindu Sachinthe <kavix@yahoo.com>
91ef2f9 to
901d821
Compare
Purpose
Migrate the Doclet application database and messaging dependencies (Postgres and NATS) from plain Component abstractions to Resource abstractions in this GitOps repository. This aligns the repository with the upstream in-repo Doclet sample templates (
samples/from-image/doclet/) and the OpenChoreo Resource / ResourceReleaseBinding model.Resolves openchoreo/openchoreo#4027
Resolves openchoreo/openchoreo#3107
Approach
postgres/andnats/component folders undernamespaces/default/projects/doclet/components/(including component descriptors, release bindings, workload definitions, and static releases).doclet-postgres(usingpostgresClusterResourceType with databasedoclet) anddoclet-nats(usingnatsClusterResourceType) undernamespaces/default/projects/doclet/resources/.namespaces/default/projects/doclet/bindings/development/:spec.resourceReleaseis omitted intentionally to allow the OpenChoreo Resource Controller to cut the initial immutable release upon resource creation before binding promotion.resourceTypeEnvironmentConfigs.adminEnabledis set tofalseby default for GitOps security hygiene (avoids unauthenticated gateway exposure of Adminer demo superusers and NATS/varzendpoints).document-svc: Wireddependencies.resourcesfordoclet-postgres(bindinghost,port,username,password,database) anddoclet-nats(bindingurl). Removed hardcoded database credentials.collab-svc: Wireddependencies.resourcesfordoclet-nats(bindingurl).bulk-gitops-release).Related Issues
Checklist
postgres/andnats/component directories undernamespaces/default/projects/doclet/components/with Resource + ResourceReleaseBinding per backend (mirrorresources/andbindings/)document-svcandcollab-svcworkloads to consume dependencies viadependencies.resources[]document-svcpods running with live database read/write verifiedRemarks
Resource Promotion Procedure under Flux CD
When Flux synchronizes these manifests, the
ResourceReleaseBindings remainPendinguntil promoted to the firstResourceReleasecut by the OpenChoreo controller:Connectivity Verification (with
adminEnabled: false)document-svcHTTP endpoints (GET /documents,POST /documents) and container startup logs.collab-svcand checking connection logs.Live End-to-End Test Results
r-doclet-postgres-development-14f4e524-0:1/1 Running(StatefulSet)r-doclet-nats-development-651ded21-5bf84f778f-rr5gw:1/1 Running(Deployment)doclet-postgres-development:Ready=Truedoclet-nats-development:Ready=Truedocument-svc-development-a2c28cff:1/1 RunningDB_HOST,DB_PORT,DB_USER,DB_PASSWORD,DB_NAME,DOCLET_NATS_URL).POST /documents {"title":"Test Document Live Verification"}->200 OK(created withdocument_id)GET /documents->200 OK(retrieved document list successfully).