[vtadmin-api] Add static file service discovery implementation #7229
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.
Signed-off-by: Sara Bee 855595+doeg@users.noreply.github.com
Description
Two changes in this PR:
:15991
in./docker/local/run.sh
so that vtadmin (running outside of Docker) can issue requestsThe best part is that now we can run vtadmin-api and vtadmin-web locally, using a local Vitess (in Docker or otherwise). 🎉 So we can add data fetching (and real data) to vtadmin-web 😈 finally the fun begins.
We can enhance this later on by watching the cluster config file(s) for changes so updates don't require a restart of vtadmin-api.
Many thanks as always to @ajm188 for answering my eight million golang questions! 💛
Running it locally
First, you'll want to run Vitess itself locally. 😸 I always run Vitess using Docker but this works fine with uncontainerized local Vitess too.
(@shlomi-noach, thank you again for the fix in #7213!)
Second, you'll need to create an empty vtgate credentials file to avoid the gRPC dialer bug mentioned in #7187. Location and filename don't matter since you'll be passing this in as a flag; I put mine at
/Users/sarabee/id1-grpc_vtgate_credentials.json
:Third, you'll want to create a cluster configuration file. This is the "static file" part of "static file service discovery". Assuming you're using the standard local Vitess set-up, you can steal this file as-is. (It comes with an entry for a bogus vtgate host to demonstrate that tagging works.) Again, filename and location don't matter since we'll be passing in the path as a flag; I put mine at
/Users/sarabee/vtadmin-cluster1.json
.Fourth, build this branch if you haven't already:
Fifth, start up vtadmin-api but make sure to update the filepaths for the vtgate creds file and static service discovery file you created above!
Sixth and finally, we can curl vtadmin-api and get a valid response! 🎉
Related Issue(s)
Checklist
Deployment Notes
N/A since vtadmin isn't in the deployment path :D
Impacted Areas in Vitess
Components that this PR will affect: