Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use consistent-hash load balancer with kubernetes resolver for dispatch #284

Merged
merged 5 commits into from
Nov 15, 2021

Conversation

ecordell
Copy link
Contributor

@ecordell ecordell commented Nov 12, 2021

This PR adds a new flag --dispatch-upstream-addr and optional --dispatch-upstream-ca-path

If set, spicedb will use the new consistent hash loadbalancer (which is just the existing consistent hashring, wired into grpc-go) to pick endpoints for a dispatch request. This is an alternative to configuring a client to watch the a Dispatch API provider like servok.

This also adds support for using the kubernetes name resolver strategy provided by kuberesolver.

Example:

spicedb serve --grpc-preshared-key "somerandomkeyhere" --dispatch-upstream-addr=kubernetes://spicedb.dev:50053

@ecordell ecordell requested a review from jakedt November 12, 2021 19:17
@ecordell ecordell changed the title use consistent-hash load balancer with kubernetes endpoint resolver for use consistent-hash load balancer with kubernetes resolver for dispatch Nov 12, 2021
@github-actions github-actions bot added the area/dependencies Affects dependencies label Nov 12, 2021
@ecordell ecordell force-pushed the consistent-lb branch 3 times, most recently from ab98b09 to c7610af Compare November 12, 2021 20:18
@ecordell ecordell marked this pull request as ready for review November 12, 2021 20:27
@ecordell ecordell added area/dispatch Affects dispatching of requests area/CLI Affects the command line area/perf Affects performance or scalability labels Nov 12, 2021
pkg/balancer/balancer.go Outdated Show resolved Hide resolved
cmd/spicedb/serve.go Show resolved Hide resolved
@ecordell ecordell force-pushed the consistent-lb branch 2 times, most recently from 24f15c7 to 3a16b78 Compare November 12, 2021 20:48
@ecordell
Copy link
Contributor Author

@jakedt also bumped the replicationFactor to a uint16

@github-actions github-actions bot added the area/tooling Affects the dev or user toolchain (e.g. tests, ci, build tools) label Nov 12, 2021
@ecordell ecordell requested a review from jakedt November 12, 2021 20:57
Copy link
Member

@jakedt jakedt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is more servok-related code that we can kill now, right?

internal/dispatch/remote/cluster.go Outdated Show resolved Hide resolved
@ecordell ecordell force-pushed the consistent-lb branch 2 times, most recently from 24da454 to 416bf07 Compare November 12, 2021 22:03
cmd/spicedb/serve.go Outdated Show resolved Hide resolved
proto/buf-generate.sh Outdated Show resolved Hide resolved
jakedt
jakedt previously approved these changes Nov 15, 2021
@ecordell ecordell force-pushed the consistent-lb branch 3 times, most recently from b6d5e11 to ed9956a Compare November 15, 2021 17:08
@ecordell ecordell merged commit 6779f26 into authzed:main Nov 15, 2021
@github-actions github-actions bot locked and limited conversation to collaborators Nov 15, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area/CLI Affects the command line area/dependencies Affects dependencies area/dispatch Affects dispatching of requests area/perf Affects performance or scalability area/tooling Affects the dev or user toolchain (e.g. tests, ci, build tools)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants