Skip to content

Repository files navigation

OpenEverest Database Maintenance Jobs Plugin

A community plugin for OpenEverest that runs long-running database maintenance operations as Kubernetes Jobs and surfaces their full lifecycle — live progress, cancellation, and run history — inside the OpenEverest UI.

Status: early development. The architecture is settled and implementation is underway. Nothing here is production-ready yet. See docs/roadmap.md for what is in scope for v0.1.

Why this plugin exists

Database maintenance operations such as VACUUM are routine, occasionally long-running, and awkward to run safely against a managed instance. They typically end up as an ad-hoc kubectl exec, a one-off Job someone wrote by hand, or a psql session on a laptop. None of those leave a record, none of them are cancellable from a UI, and none of them are visible to the rest of the team.

This plugin treats a maintenance operation as a first-class, observable unit of work:

  • It runs in an isolated Kubernetes Job with its own resource limits and deadline.
  • Its progress streams to the browser while it runs.
  • It can be cancelled.
  • Its outcome is persisted and searchable after the fact.

Scope of v0.1

A single operation: PostgreSQL VACUUM (VERBOSE, ANALYZE) against a user-selected table.

The operation count is deliberately small. The purpose of v0.1 is to build the infrastructure around long-running Jobs correctly — orchestration, progress streaming, cancellation, result collection, persistence, and RBAC — not to accumulate a catalogue of SQL commands. Additional operations (REINDEX CONCURRENTLY, MySQL OPTIMIZE TABLE) are deferred until that infrastructure is complete; see docs/roadmap.md.

How it fits into OpenEverest

The plugin is a standard OpenEverest extension. It ships:

  • a frontend ESM bundle that the OpenEverest UI loads dynamically and that registers extension points on the instance detail page, the settings page, and the sidebar;
  • a backend service that the OpenEverest server reverse-proxies to under /v1/plugins/maintenance-jobs/*, which orchestrates the Kubernetes Jobs;
  • a Plugin custom resource that registers both with the platform.

Requests reach the backend only through the OpenEverest proxy, which applies authentication and the plugin/use RBAC check before forwarding.

For the component model, the run state machine, and the framework constraints this design works within, see docs/architecture.md.

Framework observations

Building this plugin surfaced a few places where the OpenEverest plugin framework does not yet provide a facility we needed, along with the workarounds we used. These are recorded — descriptively, not as proposals — in docs/framework-observations.md.

Repository layout

cmd/maintenance-jobs/    Backend entrypoint
internal/                Private Go packages (HTTP, orchestration, storage)
api/                     Wire contract shared by the backend and the frontend
ui/                      Frontend plugin bundle (React + TypeScript)
charts/maintenance-jobs/ Helm chart: Deployment, Service, RBAC, PVC, Plugin CR
docs/                    Architecture, roadmap, install guide, and design notes

Installation

See docs/install.md to build the image, install the chart, and run the demo.

Prerequisites

Tool Version Notes
Go 1.26+ Matches the OpenEverest toolchain
Node.js 20+ For building the frontend bundle
pnpm 9.4+ Matches the OpenEverest UI package manager
Helm 3.x For installing the chart
Kubernetes 1.29+ With OpenEverest >= 2.0.0 installed

Development

make help

lists the available targets. The common ones are make build, make test, make lint, and make ui-build.

Contributing

Issues and pull requests are welcome. Please open an issue to discuss any substantial change before writing code, so the design can be agreed first.

License

Apache License 2.0. See LICENSE.

About

Database maintenance plugin for OpenEverest powered by Kubernetes Jobs.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages