[vtctld] Add 'enable_vtctld_ui' flag to vtctld to explicitly enable (or disable) the vtctld2 UI #9614
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.
Description
This PR closes #9194 by adding a flag to enable/disable the vtctld2 UI. This default value is true, which means that the vtctld2 UI will continue to be enabled by default. In other words, nothing will change unless operators explicitly opt out of the vtctld2 UI.
With
-enable_vtctld_ui=false
, any requests to any of the following vtctld URLs will 404:This flag does not affect the HTTP API that the vtctld serves on /api/ (used by the web app).
On nomenclature.
I went back and forth for far too long on whether the flag should be
enable_
(and default to true) ordisable_
(and default to false).Ultimately, I went with
enable_
given the next step will be to disable the UI by default, meaning this flag will default tofalse
and Vitess operators will have to explicitly opt-in to enable the UI. (We can discuss the timing and communication around this next step in the forthcoming RFC for removing the vtctld2 codebase.)That said, I'm happy to switch this up if another approach would make more sense. :)
What it looks like
An easy way to test this out is to update examples/local/scripts/vtctld-up.sh with the flag as follows:
(Do note there is no space before the
false
value as described in the flag package.)Then, all requests to http://localhost:15000/app/ (and any subroutes) will 404.
One can also verify that /api/ requests still work:
$ curl http://localhost:15000/api/keyspaces/ [ "commerce" ]
Related Issue(s)
Closes #9194
Checklist
Deployment Notes
Noted above.