script: introduce db/dump script command #164
Conversation
Introduce a `db/dump` script command that dumps the entire contents of StateDB as JSON. This command mimics the behavior of the already existing `/dump/` HTTP API, and is intended to be used to retrieve a snapshot of the DB (for instance during sysdump collection), without having to register the HTTP API, and implement a custom client. Signed-off-by: Marco Iorio <marco.iorio@isovalent.com>
Signed-off-by: Marco Iorio <marco.iorio@isovalent.com>
|
There was a problem hiding this comment.
LGTM.
Perhaps we could think about just removing the HTTP stuff completely once we've switched over to this? As far as I remember it wasn't used for anything else except the dumping. Would also allow removing the 'AnyTable/RemoteTable' thing.
EDIT: Oh wait, 'cilium-dbg/cmd/status.go' uses the 'RemoteTable' construct. Maybe that could be rewritten to use a shell command instead (it's just doing basically the 'health' command as part of 'cilium status').
Yeah, I was wondering about the same as well. It shouldn't be difficult to rewrite the current usages to directly invoke the corresponding shell command once this is merged and the dependency bumped on the Cilium side. The actual removal will likely need to be postponed to a new minor version, though, as it is technically a breaking change. |
Introduce a
db/dumpscript command that dumps the entire contents of StateDB as JSON. This command mimics the behavior of the already existing/dump/HTTP API, and is intended to be used to retrieve a snapshot of the DB (for instance during sysdump collection), without having to register the HTTP API, and implement a custom client.I'd additionally nominate this PR for backport to the v0.5 series, which is still used by Cilium v1.19, given that it has no regression risks being only a script command, but it will help with possible troubleshooting, given that it is the first Cilium version in which the operator also includes some statedb usage.
Related: cilium/cilium#46503