From ba9518f463306b3c04c39ec5ddb52c55b55b3667 Mon Sep 17 00:00:00 2001 From: fahimfaisaal Date: Sun, 8 Nov 2026 21:56:14 +0600 Subject: [PATCH 01/74] chore!: drop Kubernetes discovery Remove EndpointSlice discovery, the kubernetes config block, wizard prompts, KUBECONFIG in the collector lease, pod noun and k8s label mode. Config with a kubernetes block now fails to load: "kubernetes discovery was removed; use static or dns". Static and DNS unchanged. Drop client-go deps. Lease keeps its unused kubeconfig column (written empty). BREAKING CHANGE: kubernetes servers in config.json no longer load. --- PRODUCT.md | 2 +- README.md | 99 ++++---------- cmd/server.go | 8 +- cmd/server_list_test.go | 2 - cmd/server_test.go | 65 ++------- cmd/web.go | 8 +- cmd/web_test.go | 15 +-- go.mod | 42 ------ go.sum | 111 ---------------- internal/api/client_test.go | 22 --- internal/api/instance_test.go | 3 - internal/api/pool.go | 30 +---- internal/collect/collect.go | 2 +- internal/config/config.go | 65 ++++----- internal/config/config_test.go | 107 +++++---------- internal/config/prompt.go | 87 +----------- internal/config/server_test.go | 2 +- internal/discovery/discovery.go | 4 +- internal/discovery/discovery_test.go | 178 +------------------------ internal/discovery/kubernetes.go | 191 --------------------------- internal/discovery/static_test.go | 15 --- internal/fleet/act.go | 13 +- internal/fleet/act_test.go | 7 +- internal/fleet/balancer.go | 26 ++-- internal/fleet/balancer_test.go | 29 ++-- internal/fleet/history_test.go | 4 +- internal/fleet/noun.go | 13 +- internal/fleet/noun_test.go | 5 +- internal/fleet/poller.go | 42 +----- internal/fleet/poller_test.go | 50 +------ internal/store/control.go | 17 +-- internal/store/control_test.go | 4 +- internal/web/actions.go | 21 +-- internal/web/actions_test.go | 2 - internal/web/fixtures_test.go | 5 - internal/web/server.go | 16 +-- internal/web/server_test.go | 63 +-------- 37 files changed, 184 insertions(+), 1191 deletions(-) delete mode 100644 internal/discovery/kubernetes.go diff --git a/PRODUCT.md b/PRODUCT.md index 9d5d717..a18ce74 100644 --- a/PRODUCT.md +++ b/PRODUCT.md @@ -21,7 +21,7 @@ Live dashboard and control panel for varmq worker fleets. Talks to varmq's REST ## Positioning - No agent, no database to run: one binary on the user's machine; collects only while `vartop web` runs. -- Finds instances from static URLs, Kubernetes EndpointSlices or DNS, followed live; detects one URL answered by several instances behind a load balancer. +- Finds instances from static URLs or DNS, followed live; detects one URL answered by several instances behind a load balancer. - Merges every instance, or shows one; queue data grouped by Queue ID, never summed across instances. ## Operating Context diff --git a/README.md b/README.md index cc199e2..a37ee3e 100644 --- a/README.md +++ b/README.md @@ -34,9 +34,9 @@ and pause, resume, restart, stop or resize it, from your browser or the command [varmq](https://github.com/goptics/varmq) is a typed worker pool and message queue for Go. Each process that uses it can serve its workers over a small REST API, `varmq.Handler`. **vartop** talks to that API on every instance of your service and puts the whole fleet in one place: - **`vartop web`**, a dashboard in your browser. It merges every instance (or shows one), refreshes at each poll, keeps the history in a local SQLite store, and lets you act on workers. -- **`vartop action`** and **`vartop concurrency`**, the same actions from a terminal or a script, against every endpoint of a server at once: each static URL, or each pod or address Kubernetes or DNS discovery finds. +- **`vartop action`** and **`vartop concurrency`**, the same actions from a terminal or a script, against every endpoint of a server at once: each static URL, or each address DNS discovery finds. -There is no agent to deploy and no database to run: vartop is one binary on your machine. It finds your instances from a fixed list of URLs, the pods behind a Kubernetes Service, or the addresses a DNS name resolves to, and it collects only while `vartop web` runs. +There is no agent to deploy and no database to run: vartop is one binary on your machine. It finds your instances from a fixed list of URLs or the addresses a DNS name resolves to, and it collects only while `vartop web` runs. ## Features @@ -55,7 +55,7 @@ There is no agent to deploy and no database to run: vartop is one binary on your **Find every instance** -- **Static endpoints, or Kubernetes EndpointSlices and DNS**, the last two followed live as instances scale, restart or move. +- **Static endpoints or DNS**, DNS followed live as instances scale, restart or move. - **Load-balancer detection.** One URL answered by several instances is recognised, and each instance behind it is listed. **Safe by default** @@ -76,9 +76,9 @@ http.ListenAndServe(":8080", mux) vartop then calls `http://:8080/varmq`. The API is unauthenticated by design: keep it on a trusted network, or put it behind a proxy that checks a bearer token and give vartop that `token` (sent as `Authorization: Bearer `). -**vartop reaches each instance directly** when it discovers them through [Kubernetes](#kubernetes) or [DNS](#dns): run it inside the network, or over a VPN or route that reaches their addresses. +**vartop reaches each instance directly** when it discovers them through [DNS](#dns): run it inside the network, or over a VPN or route that reaches their addresses. -**Go 1.26+** to install it (the Kubernetes client libraries need it). +**Go 1.26+** to install it. ## Quick start @@ -90,7 +90,7 @@ vartop then calls `http://:8080/varmq`. The API is unauthenticated by Or build from source: `git clone https://github.com/goptics/vartop.git && cd vartop && make build` (binary at `bin/vartop`). -2. **Open the dashboard.** On first run a short wizard sets up your first server: a name, then a **static endpoint**, **Kubernetes** discovery (context, namespace, service or label selector) or **DNS** discovery (host and port), and an optional token. +2. **Open the dashboard.** On first run a short wizard sets up your first server: a name, then a **static endpoint** or **DNS** discovery (host and port), and an optional token. ```bash vartop web @@ -175,7 +175,7 @@ Press Ctrl+C to stop; collection stops with it. | `vartop` | Print help | | `vartop web` | Serve the dashboard and collect every server while it runs | | `vartop server list` | List all servers (static servers with their health status) | -| `vartop server add` | Register a new server via the interactive wizard (static, Kubernetes or DNS) | +| `vartop server add` | Register a new server via the interactive wizard (static or DNS) | | `vartop server use ` | Set the default server | | `vartop server remove ` | Remove a server (`--all`: every server) | | `vartop server set endpoint\|token\|interval\|history ` | Update a server property (`endpoint` accepts a comma-separated list, static servers only; `history` is whole days, `1d` to `30d`) | @@ -183,7 +183,7 @@ Press Ctrl+C to stop; collection stops with it. | `vartop concurrency ` | Set a worker's concurrency pool size | | `-s`, `--server ` | The server `web`, `action` and `concurrency` use (overrides the default) | -`action` and `concurrency` run against **every endpoint** of the server (each static endpoint, or each pod or address Kubernetes or DNS discovery finds) concurrently and print one result line per endpoint; the command fails if any endpoint fails. Behind a load-balancer URL that is one instance, the one the balancer picks: see [Load balancers](#load-balancers). `concurrency` is per instance, so `concurrency orders 8` on 3 endpoints gives 24 workers in total. To target one endpoint, pass its URL: +`action` and `concurrency` run against **every endpoint** of the server (each static endpoint, or each address DNS discovery finds) concurrently and print one result line per endpoint; the command fails if any endpoint fails. Behind a load-balancer URL that is one instance, the one the balancer picks: see [Load balancers](#load-balancers). `concurrency` is per instance, so `concurrency orders 8` on 3 endpoints gives 24 workers in total. To target one endpoint, pass its URL: ```bash vartop action orders pause # every endpoint @@ -198,11 +198,10 @@ A page's address says what it shows, by the names the page shows, so a reload, t | Parameter | Meaning | | --- | --- | | `server=` | The configured server to show, by the key it is listed under in the config (the default server when absent, else the first configured server by name) | -| `instance=