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:
co-authored by
Claude Opus 5.5
parent
41f9b47556
commit
4518393ce1
@@ -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.
|
||||
Reference in New Issue
Block a user