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>
This commit is contained in:
Виталий Чефанов
2026-09-24 17:25:36 +03:00
co-authored by Claude Opus 5.5
parent 8b8fe341d5
commit 3cdc2583ee
36 changed files with 2909 additions and 83 deletions
+14
View File
@@ -37,6 +37,20 @@ properties:
Also collect kubelet probes and other traffic originating from node hosts, node-to-node traffic, Cilium health checks and DNS.
Off by default: on a typical cluster this is about three quarters of all flows, none of it maps to a workload, and filtering it at the Hubble agents keeps hubble-relay load several times lower.
actions:
type: object
default: {}
description: Changes the map can make to the cluster.
properties:
enabled:
type: boolean
default: true
description: |
Buttons to restart a workload, scale a Deployment or StatefulSet, delete a pod, run a CronJob now or suspend it, cordon a node.
Every action runs with the viewer's own Kubernetes identity: the DexAuthenticator passes the user's token to the module, and the API server checks it against the user's RBAC. The module's service account stays read-only, a button is shown only when the user's role allows it, and the API server's audit log records the user.
Needs the `user-authn` module, or an `externalAuthentication` that puts a token the API server accepts into the `Authorization` header. When disabled, the user's token is not passed to the module at all.
logs:
type: object
default: {}
+10
View File
@@ -22,6 +22,16 @@ properties:
Собирать также пробы kubelet и прочий трафик с хостов нод, трафик между нодами, проверки Cilium health и DNS.
По умолчанию выключено: на обычном кластере это около трёх четвертей всех потоков, ни один из них не привязан к workload'у, а отсев на агентах Hubble снижает нагрузку на hubble-relay в несколько раз.
actions:
description: Изменения, которые карта может вносить в кластер.
properties:
enabled:
description: |
Кнопки: перезапустить workload, масштабировать Deployment или StatefulSet, удалить под, запустить CronJob сейчас или приостановить его, закрыть ноду для новых подов (cordon).
Каждое действие выполняется от имени самого пользователя: DexAuthenticator передаёт модулю его токен, и API-сервер проверяет права по RBAC этого пользователя. Сервисный аккаунт модуля остаётся только на чтение, кнопка показывается, только если роль пользователя разрешает действие, а в аудит-логе API-сервера записан пользователь.
Нужен модуль `user-authn` или `externalAuthentication`, который кладёт в заголовок `Authorization` токен, принимаемый API-сервером. Если выключено, токен пользователя модулю не передаётся вовсе.
logs:
properties:
tailLines: