Commit Graph
21 Commits
Author SHA1 Message Date
Виталий ЧефановandClaude Opus 5.5 4a63f57674 v0.11.2: events of finished or since-scheduled pods are history
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-26 14:22:43 +03:00
Виталий ЧефановandClaude Opus 5.5 8ed76cd01a v0.11.1: repeated restarts and OOM kills stay on the map for a day
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-25 22:50:08 +03:00
Виталий ЧефановandClaude Opus 5.5 4c5eb288cb v0.11.0: HTTP details on links where Cilium parses L7
Requests, response classes, p50/p95 latency and the busiest paths per link,
from Hubble L7 flows (method, path, status, latency only; headers are never
requested). The two inner legs of a proxied connection (Envoy -> pod, and the
pod's answers to the node on an ephemeral port) are no longer counted as
links.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-25 02:13:10 +03:00
Виталий ЧефановandClaude Opus 5.5 c50020e420 v0.10.0: each viewer sees what their own RBAC allows
Until now anyone admitted through Dex saw every namespace and every log,
read with the module's service account. auth.visibility: ViewerRBAC (the
default) asks the API server as the viewer, with the token the
DexAuthenticator forwards: list pods in all namespaces means the whole
cluster; otherwise the namespaces where they can list pods. Logs also
need get pods/log, node cards list nodes, cluster-wide alerts are for
cluster-wide viewers. Traffic to a hidden namespace keeps its counts with
the peer shown as hidden. One minute cache per token hash, SSARs in
parallel (8), a cluster-wide viewer costs two.

Verified against the live cluster with two real tokens: a service
account with view in one namespace got that namespace only (0 nodes, 403
on another namespace's YAML and logs, 403 on node usage); the module's
own account, cluster-wide, got all 56 namespaces and 6 nodes; no token,
401. auth.visibility: Everything keeps the old behaviour. The
DexAuthenticator now forwards the token when either actions or ViewerRBAC
need it (templates/_helpers.tpl).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-25 01:03:50 +03:00
Виталий ЧефановandClaude Opus 5.5 ce6dad9a58 v0.9.0: vulnerabilities on the map; event counts scaled to the window
Vulnerabilities: VulnerabilityReports from operator-trivy are cached
(trimmed to the fields shown) and mapped to cards through the scanned
object in their labels. A card shows a red shield with its CRITICAL CVE
count; the details list CRITICAL and HIGH CVEs with packages, installed
and fixed versions and the advisory link, one row per CVE and image.
Counted per CVE, not per package: openssh's six subpackages had made one
CVE count six times. Kept apart from problems on purpose: on the live
cluster 22 cards have some, which would bury the "is it working" badges.

Fixes, both found on the live cluster, where they made all five current
"problems":
- a Warning event's count is cumulative since its first occurrence; four
  dex-authenticators on xeon had 38-51 probe failures over two days (one
  an hour, pods never left Ready) and were badged as a burst. The count
  is now scaled to the part of the event's lifetime the window covers.
- upmeter's smoke-mini services and pods are its synthetic test, moved
  between nodes on purpose (NoEndpoints, FailedMount while moving).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-25 00:50:37 +03:00
Виталий ЧефановandClaude Opus 5.5 c563cd3a2f v0.8.3: a manual CronJob run is not a problem
Kubernetes emits UnexpectedJob for every Job of a CronJob it did not
schedule itself; the backup job the site's maintenance starts by hand
kept a warning on wordpress-backup.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-24 18:31:23 +03:00
Виталий ЧефановandClaude Opus 5.5 b01f884530 v0.8.2: no false problems for redirecting Ingresses and deleted pods
Found on the live cluster: d8-monitoring/grafana-v10 routes
prometheus.<domain> to a Service that does not exist, but a snippet
redirects every such request, so the backend is never used. And a
verification pod created and deleted by a backup check kept a warning
badge on its namespace for 30 minutes after it was gone.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-24 18:25:11 +03:00
Виталий ЧефановandClaude Opus 5.5 1025c40561 v0.8.1: request a kubernetes-audience token for actions
user-authn adds audience:server:client_id:kubernetes to the dex
authenticator's scope only for DexAuthenticators annotated
dexauthenticator.deckhouse.io/allow-access-to-kubernetes, which is what
the console module does. v0.8.0 set sendAuthorizationHeader alone, so the
token in the header was one the API server does not accept.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-24 17:41:44 +03:00
Виталий ЧефановandClaude Opus 5.5 f24eaa3f23 Makefile: start the stopped build registry instead of waiting for it forever
After a reboot the registry container exists but is stopped; docker
inspect succeeded, nothing started it, and the readiness loop never ended.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-24 17:36:40 +03:00
Виталий ЧефановandClaude Opus 5.5 3cdc2583ee v0.8.0: problem badges, actions as the viewer, load, events, lock
Problems: cards, namespace and node boxes and the tree carry a yellow or
red badge, computed on the server from object state (crash loops, image
pulls, pending and unschedulable pods, readiness older than 2 minutes, a
stuck rollout, a failed CronJob run, Services without endpoints,
Ingresses to missing Services, node conditions), recent Warning events
(notable reasons at once, others after five repeats) and Deckhouse
ClusterAlerts mapped by their labels. A Problems panel lists them all.
Checked against the live cluster: upmeter's synthetic probe pods and
ingress-nginx's fakeservice Ingresses are excluded, they fail on purpose.

Actions: restart, scale, run a CronJob now, suspend/resume, delete a
pod, cordon/uncordon. They run with the viewer's bearer token from the
DexAuthenticator (sendAuthorizationHeader), buttons follow a
SelfSubjectAccessReview, the service account stays read-only. Cross-site
writes are refused by Sec-Fetch-Site/Origin/content type. Scale retries
on conflict: right after a restart a single Get+Update got 409.

Load (metrics.k8s.io against requests/limits/allocatable, per-pod table)
and an Events tab. Cards are locked until the padlock is opened; the map
exports to PNG; the page refreshes badges every minute in place.

Performance, measured on the live cluster:
- layout of big views 3-4x faster: equal-size cards with no edges are
  laid out on the grid ELK would produce (same sizes, checked against
  ELK on a frozen node view), skipping ~8 ms per ELK call;
- hubble-relay gets ~20% fewer flows: the to-overlay copy of pod-to-pod
  traffic is dropped at the agents; 331/331 directions unchanged;
- static files carry ETags, a reload revalidates instead of pulling
  ~2 MB of vendored scripts.

KUBECONFIG is honoured for running the binary on a workstation.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-24 17:25:36 +03:00
Виталий ЧефановandClaude Opus 5.5 8b8fe341d5 v0.7.2: empty traffic window no longer blanks the map
The flows API sent "edges": null for a window without connections (a nil
Go slice); the frontend iterated it and renderMap threw after the new
breadcrumbs were drawn, so the previous namespace stayed on screen under
the new name. The API now sends empty lists, fetchFlows guards against
null, and a failed draw reports itself in the status bar.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-23 22:18:28 +03:00
Vitaliy ChefanovandClaude Opus 5.5 1df5d3559a v0.7.1: render alert rules on DKP without operator-prometheus-crd
helm_lib_prometheus_rules only renders when "operator-prometheus-crd" is
an enabled module; on DKP 1.76 that module doesn't exist (the CRDs come
with operator-prometheus), so the two alerts were silently dropped on a
live install. Gate on the PrometheusRule API instead.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-23 21:47:20 +03:00
Vitaliy ChefanovandClaude Opus 5.5 1bd2006125 bundle: ship changelog.yaml; keep version.json out of the Helm release
Both were warnings from `dmt lint remote` on the published bundle.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-23 21:30:44 +03:00
Vitaliy ChefanovandClaude Opus 5.5 d6558c3d44 Makefile: build into a local registry, publish only final artifacts
werf keeps every stage in --repo, base images included; pushing
Deckhouse's builder/golang-alpine (762 MB layer) to Gitea over a home
uplink timed out. Stages now live in a local registry:2 and publish
crane-copies the app image, bundle and release, keeping digests.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-23 21:27:31 +03:00
Vitaliy ChefanovandClaude Opus 5.5 18869e8bfc Makefile: keep only the base images this module uses
.werf/stages/base-images.yaml defines a werf image for every key of
base_images.yml, and Deckhouse's published file has ~1200 keys; a full
build started pulling and storing all of them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-23 21:23:40 +03:00
Vitaliy ChefanovandClaude Opus 5.5 4518393ce1 Package cluster-map as a Deckhouse module
Layout, build and templates follow deckhouse/modules-template; dmt lint
passes with no findings (Go files are excluded from the Flant-only
license-header rule, see .dmtlint.yaml).

- module.yaml, openapi schemas with Russian docs, lib-helm templates:
  https modes, ingress class, publicDomainTemplate, node placement,
  priority class, PSS-restricted security context, VPA, PDB, Ingress
  plus Gateway API ListenerSet/HTTPRoute, DexAuthenticator.
- module-sdk hooks: hubble CA from d8-cni-cilium (public certificate
  only), external_auth, copy_custom_certificate.
- The app moves to images/cluster-map/src and is split into packages;
  traffic mode Continuous/OnDemand/Disabled and retention are module
  settings; graceful shutdown; Prometheus metrics and two alerts;
  frontend embedded, English and Russian, strict CSP.
- Built with werf on Deckhouse's published base images; Makefile
  publishes the registry layout modules-actions uses.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-23 21:17:52 +03:00
Vitaliy ChefanovandClaude Opus 5.5 41f9b47556 Filter infra traffic at the Hubble agents
Host-originated flows, remote-node, cilium health and DNS :53 were ~74%
of the non-reply events on a 12k-event sample and none of them map to a
workload card; streaming them all kept hubble-relay at ~400m CPU. They
are now blacklisted in the GetFlows request, so agents drop them before
the relay. The UI's "Служебный" toggle had nothing left to show and is
gone; the legend says what isn't collected.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-23 20:26:05 +03:00
Vitaliy ChefanovandClaude Opus 5.5 6ead0a0d6d Collect Hubble traffic continuously; graph from informer caches
The ring buffer on each agent holds 4095 flows, ~10 s at the observed
~380 flows/s, so the 5/15/60 min windows were really showing the last
few seconds. A background follow stream now fills per-minute buckets
for the last hour, and counts are distinct connections (5-tuples)
instead of Hubble events, with opened (SYN) and dropped broken out.
/api/flows reports coveredSec so the UI can say how much of the window
the collector has seen since start.

/api/graph reads informer caches instead of listing every kind per
request (~0.9 s before). Pod-to-workload resolution for flows uses the
same cache. YAML view drops managedFields.

Frontend: traffic refreshes in place every 30 s without relayout; dash
animation rationed (12 fps, only highlighted edges in dense views,
paused after a minute idle) since each step redraws the whole element
layer, ~15 ms on a 200-element view.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-23 20:23:20 +03:00
Vitaliy ChefanovandClaude Opus 5.5 cf84e9976f UI rework: inventory tree, compact cards, live Hubble traffic
Frontend rewritten around three panes. Inventory tree on the left
(namespaces by kind, or nodes by namespace) with search and keyboard
navigation replaces the namespace checkbox list. The map shows only the
selected namespace(s) or node: fixed-size cards inside namespace boxes,
laid out in two elk passes so a big namespace packs into rows instead of
one tall column; zoom is capped so the view no longer jumps. Details
panel has Overview / Links / YAML / Logs tabs. Light and dark themes.
Libraries are vendored, no CDN.

Backend: /api/flows reads recent flows from hubble-relay (TLS verified
with the hubble CA, no client cert needed) and aggregates them per
source/destination/port. Pods are resolved to workloads with the same
rules as the graph, since Hubble leaves Workloads empty on some flows.
Pods under non-native controllers (kruise DaemonSet, CNPG clusters,
bare Jobs, static pods) are now graph nodes too. Probes move to
/healthz: /api/graph was timing out the 1s probe.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-23 19:50:53 +03:00
Виталий ЧефановandClaude Sonnet 5 2ac0ddb6ba Add pod logs by click: /api/pods + /api/logs endpoints
Deployment/StatefulSet/DaemonSet/CronJob details now show a pod +
container picker with the pod's recent log tail (500 lines, no follow),
sitting alongside the existing raw-manifest view. Pod resolution reuses
buildGraph's ownerReferences-walking logic (ownerWorkloadID) so it stays
consistent with the schedules-on edges already shown on the graph.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-23 18:56:50 +03:00
fanchji 8f9c650960 initial: graph backend (client-go) + cytoscape.js topology frontend
Namespaces as compound parents, Deployment/StatefulSet/DaemonSet/CronJob
as workload nodes, Service/Ingress with edges derived from label-selector
matching and backend references, plus a physical-node layer via pod
placement. Click-through to live YAML manifest per node.
2026-09-23 17:40:44 +03:00