Repository navigation
feat: add server.remotesAPI and server.behavior.eventScheduler to DoltDB - #19
Closed
realnedsanders wants to merge 1 commit into
Closed
realnedsanders wants to merge 1 commit into
realnedsanders wants to merge 1 commit into
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.
|
@realnedsanders thanks so much for the contribution! There were a couple places that needed shoring up, so I went ahead and picked up your commits and made the necessary changes in this pr, which will supersede this one: #20 |
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.
Dolt's
sql-servercan serve its databases over its user-facing remotesAPI, the top-level
remotesapisection of its configuration. Clients thenclone, fetch and push with
dolt clone http://<host>:<port>/<database>.The operator renders only
cluster.remotesapi, and only with replicationenabled. It also patches its ConfigMap back on every reconcile. So today an
operator-managed DoltDB cannot serve the user-facing API, even by hand.
The operator also cannot set
behavior.event_scheduler, so stored eventsalways run (Dolt's default is
ON). An application that admits only plaindata has no way to turn the scheduler off declaratively.
This PR adds two optional fields to the
DoltDBspec. Nothing changes for aDoltDBthat sets neither.spec.server.remotesAPIrendersremotesapi.portandremotesapi.read_only.the two can be used together.
http-remotesapito the container and to theprimary, reader and internal Services. One port carries both the gRPC
calls and the plain HTTP table-file transfers.
spec.server.behavior.eventScheduler(ONorOFF) rendersbehavior.event_scheduler. Empty keeps Dolt's default.renders
Security note for users
An unauthenticated request to Dolt's remotes API runs as
rootwith anempty password (
remotesrv/http.go). The remotes port therefore needsnetwork policy that admits only trusted clients. This PR does not change
that behaviour; it only lets the operator render the API that Dolt already
has. The field's documentation could say so, if you prefer.
Testing
make generate manifests: the deepcopy and the three generated CRDs gainonly the new fields.
pkg/dolt);pkg/builder);go test $(go list ./... | grep -v /internal/controller)passes.dolt sql-server2.4.2.@@global.event_schedulerreadOFF.v0.0.1withthis commit and both fields set (
remotesAPI.port: 50052,behavior.eventScheduler: "OFF"). Its packaged browser suite cloned andpushed through the remotes API: clones fetched table files from it
directly, and publications pushed to it through an authorizing proxy. The
rendered
/db/config.yamlkept both settings. No differences were observed(SHA-256
3b31d515…) between two reconciles ofspec.envchanges, eachrolling the StatefulSet, an OOM-killed container restart and a deleted
pod.
@@global.event_schedulerreadOFFafter the deleted pod cameback. Deploying the patched operator to that cluster left another,
unchanged DoltDB alone: no roll, no restart, the same configuration.
The integration suite (
make tiltci) was not run.