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>
This commit is contained in:
Vitaliy Chefanov
2026-09-23 21:17:52 +03:00
co-authored by Claude Opus 5.5
parent 41f9b47556
commit 4518393ce1
82 changed files with 5712 additions and 1415 deletions
+189
View File
@@ -0,0 +1,189 @@
type: object
properties:
traffic:
type: object
default: {}
description: Live traffic between workloads, read from Cilium Hubble Relay.
properties:
mode:
type: string
default: Continuous
enum: ["Continuous", "OnDemand", "Disabled"]
description: |
When flows are read from Hubble.
- `Continuous` — a Hubble follow stream is always open, so every traffic window is full as soon as the map is opened. Costs hubble-relay about 100–150m CPU on a busy cluster.
- `OnDemand` — the stream opens with the first traffic request and closes after `onDemandIdleMinutes` without one. Near-zero cost while nobody looks at the map, but windows only fill while it is in use.
- `Disabled` — no connection to Hubble; the map shows configuration links only.
Traffic also stays off when the `cilium-hubble` module is disabled.
retentionMinutes:
type: integer
default: 60
minimum: 5
maximum: 1440
description: |
How far back traffic windows can reach, in minutes. Memory grows with retention and with the number of distinct connections in the cluster.
onDemandIdleMinutes:
type: integer
default: 10
minimum: 1
maximum: 120
description: In `OnDemand` mode, how long the stream stays open after the last traffic request.
collectInfraTraffic:
type: boolean
default: false
description: |
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.
logs:
type: object
default: {}
properties:
tailLines:
type: integer
default: 500
minimum: 10
maximum: 10000
description: How many last lines of a container log the Logs tab shows.
systemNamespacePrefixes:
type: array
default: ["d8-", "kube-"]
items:
type: string
description: |
Namespaces grouped as "System" in the inventory tree. An entry ending in `-` matches by prefix, any other entry matches the whole name.
ingressClass:
type: string
pattern: '^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$'
description: |
The class of the Ingress controller used for the web interface.
Optional. By default, the `modules.ingressClass` global value is used.
nodeSelector:
type: object
additionalProperties:
type: string
description: |
The same as the `spec.nodeSelector` pod parameter in Kubernetes.
If the parameter is omitted or `false`, it will be determined [automatically](https://deckhouse.io/products/kubernetes-platform/documentation/v1/#advanced-scheduling).
tolerations:
type: array
description: |
The same as `spec.tolerations` for the Kubernetes Pod.
If the parameter is omitted or `false`, it will be determined [automatically](https://deckhouse.io/products/kubernetes-platform/documentation/v1/#advanced-scheduling).
items:
type: object
properties:
effect:
type: string
key:
type: string
operator:
type: string
tolerationSeconds:
type: integer
format: int64
value:
type: string
auth:
type: object
default: {}
description: |
Access to the web interface.
Anyone admitted here sees every namespace, the manifests of workloads, Services and Ingresses (never Secrets) and container logs, through the module's own read-only service account. Restrict access with `allowedUserGroups`.
properties:
externalAuthentication:
type: object
description: |
Parameters to enable external authentication based on the Ingress NGINX [external-auth](https://kubernetes.github.io/ingress-nginx/examples/auth/external-auth/) mechanism.
> External authentication is enabled automatically if the [user-authn](https://deckhouse.io/modules/user-authn/) module is enabled.
properties:
authURL:
type: string
x-examples: ["https://example.com/dex/auth"]
description: The URL of the authentication service. If the user is authenticated, the service should return an HTTP 200 response code.
authSignInURL:
type: string
x-examples: ["https://example.com/dex/sign_in"]
description: The URL to redirect the user for authentication (if the authentication service returned a non-200 HTTP response code).
allowedUserEmails:
type: array
items:
type: string
description: |
Emails of users allowed to open the web interface.
Used if the `user-authn` module is enabled or `externalAuthentication` is set.
allowedUserGroups:
type: array
items:
type: string
x-examples:
- ["admins"]
description: |
User groups allowed to open the web interface.
Used if the `user-authn` module is enabled or `externalAuthentication` is set.
**Caution!** When used together with the [user-authn](https://deckhouse.io/modules/user-authn/) module, add these groups to the matching field of the DexProvider.
whitelistSourceRanges:
type: array
items:
type: string
x-examples:
- ["1.1.1.1/32"]
description: CIDRs allowed to open the web interface.
https:
type: object
x-examples:
- mode: Disabled
- mode: OnlyInURI
- mode: CustomCertificate
customCertificate:
secretName: "foobar"
- mode: CertManager
certManager:
clusterIssuerName: letsencrypt
description: |
What certificate type to use.
This parameter completely overrides the `global.modules.https` settings.
properties:
mode:
type: string
default: "CertManager"
description: |
The HTTPS usage mode:
- `CertManager` — the web interface is served over HTTPS with a certificate from the ClusterIssuer set in `certManager.clusterIssuerName`;
- `CustomCertificate` — the web interface is served over HTTPS with a certificate from the `d8-system` namespace;
- `Disabled` — the web interface is served over HTTP only;
- `OnlyInURI` — the web interface is served over HTTP behind an external HTTPS load balancer that terminates TLS; links are generated with the HTTPS scheme.
enum:
- "Disabled"
- "CertManager"
- "CustomCertificate"
- "OnlyInURI"
certManager:
type: object
properties:
clusterIssuerName:
type: string
default: "letsencrypt"
x-examples: ["letsencrypt", "letsencrypt-staging", "selfsigned"]
description: The ClusterIssuer used to get the certificate.
customCertificate:
type: object
default: {}
properties:
secretName:
type: string
description: |
The name of the Secret in the `d8-system` namespace to use for the web interface.
The Secret must have the [kubernetes.io/tls](https://kubernetes.github.io/ingress-nginx/user-guide/tls/#tls-secrets) format.
+100
View File
@@ -0,0 +1,100 @@
type: object
properties:
traffic:
description: Живой трафик между workload'ами из Cilium Hubble Relay.
properties:
mode:
description: |
Когда читать потоки из Hubble.
- `Continuous` — поток из Hubble открыт всегда, поэтому любое окно трафика заполнено сразу при открытии карты. На нагруженном кластере стоит hubble-relay около 100–150m CPU.
- `OnDemand` — поток открывается при первом запросе трафика и закрывается через `onDemandIdleMinutes` без запросов. Пока карту никто не смотрит, нагрузки почти нет, но окна заполняются только во время работы с картой.
- `Disabled` — без подключения к Hubble, карта показывает только связи по конфигурации.
Трафик выключен и тогда, когда выключен модуль `cilium-hubble`.
retentionMinutes:
description: |
На сколько минут назад могут смотреть окна трафика. Память растёт вместе с этим значением и с числом различных соединений в кластере.
onDemandIdleMinutes:
description: В режиме `OnDemand` — сколько минут поток остаётся открытым после последнего запроса трафика.
collectInfraTraffic:
description: |
Собирать также пробы kubelet и прочий трафик с хостов нод, трафик между нодами, проверки Cilium health и DNS.
По умолчанию выключено: на обычном кластере это около трёх четвертей всех потоков, ни один из них не привязан к workload'у, а отсев на агентах Hubble снижает нагрузку на hubble-relay в несколько раз.
logs:
properties:
tailLines:
description: Сколько последних строк лога контейнера показывает вкладка «Логи».
systemNamespacePrefixes:
description: |
Namespace, которые в дереве инвентаря попадают в группу «Системные». Элемент, заканчивающийся на `-`, сравнивается как префикс, остальные — по имени целиком.
ingressClass:
description: |
Класс Ingress-контроллера для веб-интерфейса.
Опциональный параметр. По умолчанию используется глобальное значение `modules.ingressClass`.
nodeSelector:
description: |
Аналогично параметру Kubernetes `spec.nodeSelector` у подов.
Если параметр не указан или указано `false`, значение будет определено [автоматически](https://deckhouse.ru/products/kubernetes-platform/documentation/v1/#выделение-узлов-под-определенный-вид-нагрузки).
tolerations:
description: |
Аналогично параметру Kubernetes `spec.tolerations` у подов.
Если параметр не указан или указано `false`, значение будет определено [автоматически](https://deckhouse.ru/products/kubernetes-platform/documentation/v1/#выделение-узлов-под-определенный-вид-нагрузки).
auth:
description: |
Доступ к веб-интерфейсу.
Любой, кого сюда пустили, видит все namespace, манифесты workload'ов, Service и Ingress (Secret — никогда) и логи контейнеров — через собственную read-only-учётку модуля. Ограничивайте доступ через `allowedUserGroups`.
properties:
externalAuthentication:
description: |
Параметры для подключения внешней аутентификации на основе механизма Ingress NGINX [external-auth](https://kubernetes.github.io/ingress-nginx/examples/auth/external-auth/).
> Внешняя аутентификация включается автоматически, если включен модуль [user-authn](https://deckhouse.ru/modules/user-authn/).
properties:
authURL:
description: URL сервиса аутентификации. Если пользователь прошёл аутентификацию, сервис должен вернуть код ответа HTTP 200.
authSignInURL:
description: URL, куда будет перенаправлен пользователь для прохождения аутентификации (если сервис аутентификации вернул код ответа HTTP, отличный от 200).
allowedUserEmails:
description: |
Email пользователей, которым разрешено открывать веб-интерфейс.
Используется, если включен модуль `user-authn` или задан параметр `externalAuthentication`.
allowedUserGroups:
description: |
Группы пользователей, которым разрешено открывать веб-интерфейс.
Используется, если включен модуль `user-authn` или задан параметр `externalAuthentication`.
**Внимание!** При использовании совместно с модулем [user-authn](https://deckhouse.ru/modules/user-authn/) эти группы нужно добавить в соответствующее поле DexProvider.
whitelistSourceRanges:
description: Список CIDR, которым разрешено открывать веб-интерфейс.
https:
description: |
Тип сертификата.
Этот параметр полностью переопределяет глобальные настройки `global.modules.https`.
properties:
mode:
description: |
Режим работы HTTPS:
- `CertManager` — веб-интерфейс по HTTPS с сертификатом от ClusterIssuer из `certManager.clusterIssuerName`;
- `CustomCertificate` — веб-интерфейс по HTTPS с сертификатом из namespace `d8-system`;
- `Disabled` — веб-интерфейс только по HTTP;
- `OnlyInURI` — веб-интерфейс по HTTP за внешним HTTPS-балансировщиком, который терминирует TLS; ссылки формируются со схемой HTTPS.
certManager:
properties:
clusterIssuerName:
description: ClusterIssuer, через который получается сертификат.
customCertificate:
properties:
secretName:
description: |
Имя Secret в namespace `d8-system` с сертификатом для веб-интерфейса.
Secret должен быть в формате [kubernetes.io/tls](https://kubernetes.github.io/ingress-nginx/user-guide/tls/#tls-secrets).
+33
View File
@@ -0,0 +1,33 @@
x-extend:
schema: config-values.yaml
type: object
properties:
internal:
type: object
default: {}
properties:
deployDexAuthenticator:
type: boolean
hubbleCA:
type: string
default: ""
x-examples: ["-----BEGIN CERTIFICATE-----"]
description: Public certificate of the hubble CA, read by the hubble_ca hook. Empty when cilium-hubble is not installed.
customCertificateData:
type: object
properties:
tls.crt:
type: string
x-examples:
- plainstring
tls.key:
type: string
x-examples:
- plainstring
ca.crt:
type: string
x-examples:
- plainstring
registry:
type: object
description: "System field, overwritten by Deckhouse. Don't use"