OpenEverest integration: research and plan
Status: plan, 2026-11-24. Verified in code against OpenEverest core v2.0.0-alpha.1 (main has identical monitoring code), provider-valkey v0.2.0, provider-sdk v0.4.0, openeverest/hub, and the plugin repos listed below.
Implementation status: see What shipped in the first PR at the end.
Goal
Get BetterDB listed on the OpenEverest hub, with an extension that works today on provider-valkey instances. Constraints:
- We do not modify CRs that provider-valkey owns.
- We do not go around OpenEverest’s authorization.
Decision
Ship BetterDB as a generic plugin (hub type plugin). It adds a “BetterDB” tab on Valkey instances. It gets credentials the same way the existing hub plugins do: the user’s own token on the OpenEverest /connection API is the authorization check, and the plugin’s own ServiceAccount then reads the instance’s connection Secret. An in-cluster BetterDB agent connects to every Valkey node and streams to BetterDB Cloud or a self-hosted BetterDB.
Add a monitoring integration listing later. It becomes useful once provider-valkey publishes connection sources, which Sergey has confirmed is coming. Both listings can ship from the same chart and the same agent.
Why a plugin and not a monitoring integration (verified)
| Route | Works with provider-valkey v0.2.0 today? | What BetterDB gets |
|---|---|---|
Integration, connection-based (Coroot model: requires.connection) | No. Core reports it Incompatible: “no component satisfies the requirements of MonitoringClass” (compat.go:204-206). The valkey type declares only metrics: Exporter. | — |
Integration, metrics-only (requires.metrics) | Yes: eligible (compat.go:226-247). | Only the redis_exporter endpoint over http, with no credentials. No slowlog, COMMANDLOG, CLIENT LIST or ACL LOG. Binding adds an exporter sidecar and rolls the pods. That isn’t the BetterDB product. |
| Generic plugin | Yes. | Real credentials and TLS material for each instance, so BetterDB works in full. No pod restarts and no CR changes. |
Facts behind this:
- Requirements are all-or-nothing. A class’s requirements are plain booleans (
monitoringclass_types.go:163-180). There is no “optional” or “preferred” connection, so a class can’t fall back to metrics. - Coroot is listed but works with no released provider today. No provider in the hub declares
connection:orpodMetadata:on its default branch. The hub doesn’t check that an extension works. - What the hub CI checks: schema validation, directory, name and type, README, icon, and
helm show chartfor the chart reference (verify-charts.sh:227). - Review is metadata only.
PUBLISHING.md:65-66: “A hub maintainer reviews for metadata accuracy and naming. There is no code review — the formula is a pointer, not code.” - One type per formula. A formula is a provider, a plugin or an integration (
formula-v1.json:222-226). One chart can still back two formulas. - No field restricts a formula to an engine.
supportedEnginesexists only on providers. Valkey scoping happens in the Plugin CR (extensionPoints[].providers: [valkey]), through keywords, and in the README.
Precedent: existing hub plugins that use database credentials (verified)
| Plugin | How it gets credentials |
|---|---|
plugin-mongodb-explorer (backend/main.go:145-157) | GET …/instances/{i}/connection with the user’s forwarded JWT |
plugin-bench (internal/everest/client.go:157) | Same |
plugin-migrations (everest/client.go:123) | Same |
| plugin-user-management v0.2.8 (includes a Valkey engine) | Calls /connection with the user’s JWT as the authorization check (“whoever can read the instance’s admin credentials can already manage its users”). Its own ServiceAccount then reads <inst>-conn directly through a cluster-wide ClusterRole (charts/.../rbac.yaml:9-31, engine/valkey/cluster.go:150-164). |
We copy plugin-user-management’s pattern for credentials. Unlike it, we never write the ValkeyCluster: it server-side-applies spec.acl.users, and we don’t.
Platform facts we build on (verified)
- Connection API.
GET /v1/clusters/{c}/namespaces/{ns}/instances/{i}/connection(http-api.yaml:1474) returns type, provider, host, port, username, password, uri and any extra keys. It reads the Secret named byInstance.status.connectionSecretRef(handlers/k8s/instance.go:117-139). Access needs the explicitread-connectionRBAC action. Plainreaddoesn’t imply it (pkg/rbac/rbac.go:196-197). - Plugin proxy.
/v1/plugins/{name}/*is a plain reverse proxy (internal/server/plugins.go:107-163). It forwards the user’sAuthorization: Bearerheader unchanged.- Spec 003 describes an
X-Everest-Userheader, but it isn’t implemented. - Plugin service tokens aren’t implemented either:
plugintoken.Service.Minthas no callers, and spec 003 §10.4 puts them in Phase 3. A plugin has no daemon identity of its own in OpenEverest. Background work runs under the plugin’s Kubernetes ServiceAccount, which spec 003 allows (“trust is anchored at the plugin hub”).
- Spec 003 describes an
- Events.
GET /v1/clusters/{c}/events?watch=true(SSE) carries InstanceCreated/Updated/PhaseChanged/DeletionRequested/Deletedevents. It needsread-eventsand runs under a user token. We watch Instances through our own ServiceAccount instead. - provider-valkey connection Secret
<inst>-conn(valkeycluster.go:265-314,tls.go:66-68):- Always present:
type=valkey,provider,host(the primary or headless*.svc.cluster.local),port=6379,username=default,password,uri(redis://orrediss://). - When TLS is on:
ssl=trueandca.crt. - When client certificates are accepted:
tls.crtandtls.key. - The runtime sets
status.connectionSecretRefand the conditionConnectionDetailsReady. - These are admin (
default) credentials. provider-valkey has no monitor user yet.
- Always present:
- provider-valkey topology.
- Always a
ValkeyClusterwithcluster-enabled yes, one componentengine, containerserver. - TLS is on by default, and then the cluster is TLS-only on 6379.
- The server certificate’s SANs are the headless FQDN with a
*.wildcard, the primary Service and localhost. Pod IPs are not in the SANs.
- Always a
Design
Components (one chart: betterdb-openeverest, Apache-2.0)
- Plugin CR (
extensions.openeverest.io/v1alpha1,Plugin):clusterDetailTab“BetterDB”,providers: [valkey].settingsPanel“BetterDB”, for the BetterDB URL and agent token.- The backend runs in-cluster through
serviceRef.
- Frontend: an ESM bundle built from
openeverest/generic-plugin-template, using MUI and@openeverest/plugin-theme. Spec 003 rules out iframes.- The tab shows the monitoring state for this instance: Off, Connecting, Monitoring, or an error.
- An Enable / Disable button.
- A short native summary: ops/sec, memory, clients, top slow commands.
- A deep link to the connection in BetterDB.
- Settings: URL, which is BetterDB Cloud
wss://<ws>.app.betterdb.com/agent/wsor a self-hostedwss://<host>/api/agent/ws, and the agent token. The token is stored in a Secret in the plugin namespace.
- Backend + agent: one Deployment running a new
openeverestmode of thebetterdb/agentimage. The image is TypeScript/Node and reusespackages/agent. The backend runs four flows:- Enable:
POST /v1/plugins/betterdb/instances/{c}/{ns}/{i}/enable.- Call
/connectionwith the forwarded JWT. That is the authorization check: a 403 means the user can’t enable monitoring. - Record the opt-in in the plugin’s own state: a
betterdb-targetsConfigMap in the plugin namespace. - Start monitoring.
- Call
- Run: for each opted-in instance:
- Read
status.connectionSecretRef→<inst>-connthrough the plugin ServiceAccount. Re-read it when it changes, so password rotation is handled. - Connect to
host:portover TLS withca.crt, plus the client certificate if one is present. - Discover the nodes with
CLUSTER SHARDSand open one connection per node by IP, checking that the CA signed the certificate but not the hostname. Cluster redirects are disabled. - Stream to BetterDB with identity labels: cluster, namespace, instance, node.
- Read
- Lifecycle: watch
instances.core.openeverest.iothrough the ServiceAccount, and drop targets when an instance is deleted. - Status:
GET …/statusfeeds the tab. - Disable: removes the opt-in and closes the connections.
- Enable:
- RBAC (shipped by the chart, the same as plugin-user-management):
instancesget/list/watch.secretsget/list/watch, cluster-wide or limited bywatchNamespaces.configmapsget/update in the plugin namespace.- No write access to any database CR.
Credential posture
- Today: admin credentials. We use the
defaultadmin credentials from<inst>-connbecause that is all provider-valkey publishes. On these connections BetterDB runs in read-only mode: by default it doesn’t issueCLIENT KILL,LATENCY RESET,COMMANDLOG RESETorCONFIG SET. The README and the formula say so plainly. - Later: the read-only
monitorprofile. When provider-valkey publishescredentials[{profile: monitor}]with connection sources, the agent switches to it. The ACL we will propose is in the appendix.
Deployment topologies
| Where BetterDB runs | Agent dials |
|---|---|
| BetterDB Cloud | wss://<workspace>.app.betterdb.com/agent/ws |
| Self-hosted Docker, outside the cluster | wss://<monitor-host>/api/agent/ws, which must be reachable from the cluster |
Self-hosted betterdb-monitor chart, same cluster | The Monitor Service’s in-cluster /api/agent/ws |
Work breakdown
1. Agent (packages/agent): openeverest mode
- Plugin backend HTTP server: enable, disable and status, with JWT pass-through to
/connection. - Target store in the ConfigMap. Instance watch and Secret watch through the ServiceAccount.
- Multiple targets in one process. Per-node cluster connections with no redirects.
- TLS:
- CA, client certificate and key from the Secret.
- Verify-chain-only, without a hostname check.
BETTERDB_CA_FILEso the agent trusts a self-hosted Monitor that uses a private CA.
- Identity labels and a read-only mode flag sent to the server.
- Images: multi-arch, versioned tags.
2. Monitor server (the same code ships as the Docker image and in the betterdb-monitor chart)
- Stable identity for agent connections, such as cluster id + namespace + instance + node. Today agent connections aren’t persisted (
proprietary/agent/agent-gateway.ts), and history must survive agent restarts and failovers. - Grouping by OpenEverest instance: cluster → namespace → instance → nodes.
- Read-only mode on agent connections: hide or disable the actions that change state. Also degrade per feature on
NOPERM, ready for the later monitor profile. - A “Connect OpenEverest” screen in self-hosted and Cloud. It issues an agent token (
POST /agent-tokens,type: agent) and shows thehelm installcommand. - Small summary endpoint for the plugin tab, authenticated with the agent token.
- Check cluster topology and slot metrics when each node arrives as a separate agent target.
3. Plugin repo: betterdb/openeverest-betterdb (Apache-2.0, DCO-signed commits)
- Frontend from
generic-plugin-template: tab and settings panel. - Chart
charts/betterdb-openeverest/: Plugin CR, backend/agent Deployment, Service, ServiceAccount, ClusterRole, settings Secret. - Values:
betterdb.url,betterdb.tokenorbetterdb.existingSecret,betterdb.caFile,watchNamespaces. - Tests: an end-to-end run on k3d with OpenEverest alpha.1 and provider-valkey v0.2.0 (TLS on and off, replication and cluster topologies), against a self-hosted
betterdb-monitorand against Cloud.
4. Publishing and the hub listing
- OCI: add
helm pushtooci://ghcr.io/betterdb-inc/chartsin.github/workflows/helm-publish.yml. Today it publishes only a classichelm repo indextodocs.betterdb.com/charts. Do it forbetterdb-openeverest, and forbetterdb-monitortoo, since it costs little. - Hub formula PR at
extensions/plugins/betterdb/, containingformula.yaml,README.mdand an icon:metadata.license: Apache-2.0,access: public,maturity: alpha,maintainers[].github.spec.plugin.contributes{ui: true, backend: true}plusextensionPoints(clusterDetailTab,settingsPanel).keywords: [valkey, redis, monitoring, observability].install.helm{namespace: everest-system}.- Prerequisites: a BetterDB Cloud workspace or a self-hosted BetterDB (Docker or the
betterdb-monitorchart). - README: Valkey only; uses admin connection credentials in read-only mode; needs the
read-connectionpermission to enable; no pod restarts.
- Check the plugin formula fields against
schemas/formula-v1.json:293-318andextensions/_templatebefore opening the PR.
5. betterdb-monitor chart and Docker docs
- Check that the ingress passes WebSocket upgrades on
/api/agent/ws(nginxproxy-read-timeout/proxy-send-timeout), and add a values example. - Document the Docker-only self-hosted setup: the Monitor must be reachable over
wss, with a public certificate or a CA passed to the agent.
6. Later: the monitoring integration listing
When provider-valkey declares connection: Supported and publishes connections[] and credentials[{profile: monitor}]:
- New class. Add a
betterdbMonitoringClass (ExtensionManaged,requires{connection: true, kinds: [valkey]}) and a small class controller to the same chart. SkippodMetadata: the agent gets its targets fromInstance.status.monitoring.sourcesthrough the ServiceAccount, so no pods roll. - Second formula. List it under
extensions/integrations/betterdb/. BetterDB then also appears in OpenEverest’s native Monitoring step. - Switch credentials. Move the agent to the monitor credential profile for bound instances.
Sequencing
| Step | What | Depends on |
|---|---|---|
| 0 | Reply to Sergey: tell him we’re listing a plugin now and an integration later. | — |
| 1 | Agent openeverest mode | — |
| 2 | Monitor: stable agent identity, grouping, read-only mode, Connect screen, summary endpoint | — |
| 3 | Plugin repo: frontend and chart | — |
| 4 | End-to-end on k3d with alpha.1 and provider-valkey v0.2.0 | 1–3 |
| 5 | OCI publish and hub plugin formula PR | 4 |
| 6 | Integration class and second formula | provider-valkey connection sources |
Steps 1–3 run in parallel, and none of them waits on upstream.
Risks
- Admin credentials.
- Risk: the agent holds the
defaultpassword until provider-valkey ships a monitor user. - Mitigation: read-only mode on our side, enforced in both the agent and the Monitor, and stated plainly in the README. Enabling requires
read-connection, which already implies the user can see these credentials.
- Risk: the agent holds the
- Plugin ServiceAccount reads Secrets cluster-wide.
- Risk: plugin-user-management needs the same, so there is precedent.
- Mitigation: offer
watchNamespacesto narrow it.
- No plugin daemon identity in OpenEverest.
- Risk: the opt-in happens with a user token, but continuous monitoring runs under our ServiceAccount.
- Mitigation: this is the plugin-user-management model and acceptable under spec 003. Revisit when Phase 3 service tokens ship.
- TLS rework (provider-valkey #49 / core #3707). The CA location and TLS options will move. We always read the CA from
<inst>-conn(ca.crt), which #49 says stays. - Alpha churn.
- Risk: specs 003 and 007 are Draft. Open hub PR #124 may remove
spec.compatibility. Contract versioning (#3700–#3706) is in flight. - Mitigation: pin to alpha.1 and re-check at each release.
- Risk: specs 003 and 007 are Draft. Open hub PR #124 may remove
- Hub review is metadata-only.
- Risk: maintainers will judge the formula, the README and the RBAC claims.
- Mitigation: be explicit about Secret access and the use of admin credentials.
Draft reply to Sergey
Gotcha, thanks! Plan: we’ll ship BetterDB as a generic plugin first. It adds a BetterDB tab on Valkey instances, the user enables it with their own
read-connectionpermission, and an in-cluster agent streams to BetterDB Cloud or self-hosted. It follows the plugin-user-management credential pattern and never touches the ValkeyCluster. No pod restarts either. We’ll send the hub formula once it’s tested on alpha.1. When provider-valkey publishes connection sources and a monitor credential, we’ll add abetterdbMonitoringClass to the same chart and list it as an integration too. Happy to propose the monitor ACL for that.
Appendix: proposed monitor ACL (for the integration phase)
These are the commands BetterDB sends on its read-only monitoring path, taken from apps/api/src and packages/*/src:
+@connection +ping +info +role +time +config|get +command|info +module|list +function|list
+client|list +client|info
+slowlog|get +slowlog|len +commandlog|get +commandlog|len
+latency|latest +latency|history +latency|doctor
+memory|stats +memory|doctor +memory|usage
+cluster|info +cluster|nodes +cluster|shards +cluster|slots +cluster|getslotmigrations
+acl|log +acl|users +acl|whoami
+dbsize +scan +type +ttl +pttl +object|encoding +object|freq +object|idletime
~*
Before proposing it, validate it against Valkey 9.0/9.1 command names.
What shipped in the first PR
Branch feat/openeverest-plugin, in this monorepo rather than a separate plugin repo: one place for the agent, the chart and the frontend. The chart and the frontend package are Apache-2.0 on their own.
| Area | Shipped | Where |
|---|---|---|
Agent openeverest mode | Plugin backend (enable / disable / status, settings, /main.js), ConfigMap opt-in store, Instance and Secret informers through the ServiceAccount, per-node connections with no redirects, chain-only TLS, BETTERDB_CA_FILE, identity labels and read-only in the hello | packages/agent/src/openeverest/ |
| Monitor server | Connection id derived from identity labels (agent-openeverest-<hash>), read-only enforced in AgentDatabaseAdapter on every command, readOnly on the connection status | proprietary/agent/, packages/shared/src/types/{agent-protocol,command-safety}.ts |
| Frontend | ESM bundle, clusterDetailTab (valkey only) and settingsPanel, built into the betterdb/agent image | packages/openeverest-plugin/ |
| Chart | Plugin CR, Deployment, Service, ServiceAccount, ClusterRole or per-namespace Roles, state Role, settings Secret; helm-unittest suites | charts/betterdb-openeverest/ |
| Publishing | helm-publish-oci.yml pushes to oci://ghcr.io/betterdb-inc/charts (both charts) | .github/workflows/ |
| Docs and hub | Install guide, draft formula + README validated against formula-v1.json | docs/install/openeverest.md, charts/betterdb-openeverest/hub/ |
Facts learned while implementing that correct the plan above:
- The plugin proxy base is
/v1/clusters/{cluster}/plugins/{name}, not/v1/plugins/{name}, and the backend sees bare paths (/api/...,/main.js,/healthz). GET requests are not authenticated at the proxy; POST/PUT/DELETE need a session anduseon the plugin. The backend therefore serves nothing sensitive on GET and gates enable and disable on the/connectioncheck. providersscoping lives on the extension point (in the CR’sfrontend.extensionPoints[]and inregisterExtension), not at the top of the Plugin spec. The tab props carryinstanceNameandnamespace; the cluster name comes fromapi.basePath.status.connectionSecretRefis an object{name}. provider-valkey always runscluster-enabled yes, so per-node discovery is the only path; the agent’s single-node fallback is for other sources.- Node identity uses the Valkey cluster node id (stable in
nodes.confon the volume), with the pod name from reverse DNS for display. Pod IPs change on restart, so they are not part of the identity. - Connection ids are scoped by the agent token’s name, not its id: tokens have no owner today, and the name is the handle an admin controls. Rotating a token under the same name keeps the ids; a token under another name cannot take a node over. Identities are validated on arrival and capped at 512 per token.
- Read-only connections redact
requirepass,masterauth/primaryauthand the TLS passphrases inCONFIG GETreplies and the password hashes inACL LIST/ACL GETUSER(agent and Monitor both), rather than denying the commands, so the Monitor’s own config and ACL views keep working. The agent replaces each secret with<redacted:xxxxxxxx>, an 8-hex HMAC under a random 32-byte key in the<release>-fingerprintSecret, which Helm generates and keeps (or the user brings) and the plugin only reads;createon secrets would let its ServiceAccount mint tokens for other ServiceAccounts. The tag is the same for the same secret on every node and instance, so ACL drift and the change webhooks still see rotations. The key is never derived from the instance password, which would let the server test password guesses offline against the tags, and never leaves the plugin. - The Monitor answers a registered hello with a
welcomemessage (identity,readOnly,serverVersion). An identified agent that gets none within 15s closes the socket and reconnects with the usual backoff, reporting “BetterDB did not acknowledge this node”, because a busy or restarting Monitor can be late too. A Monitor from before this PR never sends one, so the node keeps that status. Only awelcomewithidentitynottruemakes the agent stop reconnecting and report “BetterDB server too old: needs Monitor 0.57.0 or later, or BetterDB Cloud”. Cluster replicas run withREADONLYso keyed reads are served locally.
TODO (out of scope of the first PR)
- UI grouping by OpenEverest instance in the Monitor app (cluster → namespace → instance → nodes). The identity labels are on
AgentConnectionInfoalready; the connections list shows one entry per node namednamespace/instance/pod. - Hide or disable state-changing actions in the Monitor UI for
readOnlyconnections. The server refuses them today; the UI still shows the buttons and surfaces the error. - “Connect OpenEverest” screen in self-hosted and Cloud: issue the agent token and print the
helm installcommand. - Summary endpoint for the plugin tab (ops/sec, memory, clients, top slow commands), authenticated with the agent token. The tab shows connection state only.
- Cluster topology and slot metrics when each node arrives as a separate agent target: check what the cluster pollers do with per-node agent connections.
- MonitoringClass integration and the second hub formula, once provider-valkey publishes connection sources and a monitor credential.
- Monitor profile ACL: validate the appendix against Valkey 9.0/9.1 command names before proposing it.
- E2E in CI.
scripts/openeverest-e2e.shpasses locally on kind (Kubernetes 1.32, OpenEverest 2.0.0-alpha.1, provider-valkey 0.2.0: a TLS 3-shard instance, 6 nodes streaming read-only, removed on disable). It is not wired into a workflow yet; it needs docker + kind and about 15 minutes. - Settings are not editable from the UI. Any OpenEverest user with a session could otherwise repoint every agent to their own server, and the plugin backend has no admin check to call. The URL and token come from the chart (values or
existingSecret) only; the NetworkPolicy limits ingress to everest-server. Revisit if OpenEverest grows plugin service tokens or an admin check.