Repository navigation
feat: add server.remotesAPI and server.behavior.eventScheduler to DoltDB - #20
Merged
Merged
Conversation
Dolt's sql-server can serve its databases over the user-facing remotes API (the top-level `remotesapi` section of its configuration), so that clients clone, fetch and push with `dolt clone http://…/db`. The operator rendered only `cluster.remotesapi`, and only with replication enabled, and it patches its ConfigMap back on every reconcile, so the user-facing API could not be turned on for an operator-managed DoltDB. `spec.server.remotesAPI` is optional. When set, the operator renders `remotesapi.port` (default 50052, apart from the replication port 50051) and `remotesapi.read_only`, and adds the port as `http-remotesapi` to the container and to the primary, reader and internal Services. The one port carries the gRPC calls and the plain HTTP table-file transfers. `spec.server.behavior.eventScheduler` is optional, ON or OFF, and renders `behavior.event_scheduler`. When empty, Dolt's default (ON) applies, as before. Nothing changes for a DoltDB that sets neither field.
Follow-up to the user-facing remotes API support: - Expose the remotes API port only on the standalone and primary Services. Dolt does not refuse pushes to a standby through this API, so the reader and headless Services no longer advertise it. - Reject a remotesAPI.port that collides with the listener, cluster remotes API, MCP, metrics or profiler port with CEL rules, instead of letting the pod crash-loop on bind. - Document how the API authenticates: Basic credentials of a SQL user, CLONE_ADMIN for reads and SUPER for pushes, sent in plaintext. - Make the container and Service port tests table-driven, unit-test the CEL rules against the generated CRD schema, and add integration tests for clone over the remotes API, refusal of unauthenticated clones, the event scheduler and admission of colliding ports.
reltuk
approved these changes
Oct 27, 2026
rikez
reviewed
Oct 27, 2026
|
|
||
| // The user-facing remotes API port must not collide with any other port the server listens on. | ||
| // Defaults are spelled out because an omitted parent object is not defaulted. | ||
| // +kubebuilder:validation:XValidation:rule="!has(self.remotesAPI) || self.remotesAPI.port != (has(self.listener) && has(self.listener.port) ? self.listener.port : 3306)",message="remotesAPI.port must differ from listener.port" |
Collaborator
There was a problem hiding this comment.
These rules can get really complex overtime. We can eventually implement admission webhooks to validate these fields in a more maintainable manner.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds two optional
DoltDBfields; nothing changes for specs that set neither.spec.server.remotesAPIserves Dolt's user-facing remotes API (clone/fetch/push). The port defaults to50052, apart from the replication port50051.spec.server.behavior.eventScheduler(ON/OFF) setsbehavior.event_scheduler.On top of @realnedsanders' commit:
this API.
CLONE_ADMINto read andSUPERto push.