Skip to content

feat: add LinkedDatabase CRD#238

Draft
tkelkermans wants to merge 1 commit into
nutanix-cloud-native:mainfrom
tkelkermans:codex/linked-database-crd
Draft

feat: add LinkedDatabase CRD#238
tkelkermans wants to merge 1 commit into
nutanix-cloud-native:mainfrom
tkelkermans:codex/linked-database-crd

Conversation

@tkelkermans

Copy link
Copy Markdown

Summary

  • Add a namespaced LinkedDatabase CRD for creating logical PostgreSQL databases on an existing NDB database instance.
  • Map reconciliation to POST /databases/{sourceDatabaseId}/linked-databases with body {"databases":[{"databaseName":"<name>"}]}.
  • Support identifying the source instance by spec.sourceDatabaseId or by spec.sourceDatabaseName resolved from NDBServer status.
  • Check existing linked databases before issuing create, so an already-present linked database is adopted into CR status instead of posted again.
  • Add generated CRD/RBAC, Helm CRD/RBAC, API helpers, controller tests, and README documentation.

Scope notes

  • This PR implements the create/observe flow only. Deleting a LinkedDatabase CR does not delete the linked database from NDB.

Verification

  • make test
  • bin/kustomize build config/default >/tmp/ndb-default.yaml
  • helm lint deploy/helm

@manavrajvanshi

Copy link
Copy Markdown
Contributor

Hi @tkelkermans

Is there any specific use-case that would require a separate linked-database CRD and controller specifically? Have you considered moving the linked-databases within the Databases custom resource instead? Were there any challenges in that approach?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants