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
+85
View File
@@ -0,0 +1,85 @@
{{- if and .Values.global.modules.publicDomainTemplate .Values.global.clusterIsBootstrapped }}
{{- $moduleGateway := dict }}
{{- include "helm_lib_module_gateway" (list . $moduleGateway) }}
{{- if eq (include "helm_lib_module_ingress_enabled" .) "true" }}
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: cluster-map
namespace: d8-cluster-map
{{- include "helm_lib_module_labels" (list . (dict "app" "cluster-map")) | nindent 2 }}
annotations:
web.deckhouse.io/export-name: "cluster-map"
web.deckhouse.io/export-icon: "/icon.svg"
{{- if and (ne (include "helm_lib_module_https_mode" .) "Disabled") .Values.clusterMap.auth.externalAuthentication }}
nginx.ingress.kubernetes.io/auth-signin: {{ .Values.clusterMap.auth.externalAuthentication.authSignInURL | quote }}
nginx.ingress.kubernetes.io/auth-url: {{ .Values.clusterMap.auth.externalAuthentication.authURL | quote }}
nginx.ingress.kubernetes.io/auth-response-headers: "X-Auth-Request-User,X-Auth-Request-Email"
{{- end }}
{{- if .Values.clusterMap.auth.whitelistSourceRanges }}
nginx.ingress.kubernetes.io/whitelist-source-range: {{ .Values.clusterMap.auth.whitelistSourceRanges | join "," | quote }}
{{- end }}
nginx.ingress.kubernetes.io/configuration-snippet: |
{{- include "helm_lib_module_ingress_configuration_snippet" . | nindent 6 }}
spec:
ingressClassName: {{ include "helm_lib_module_ingress_class" . | quote }}
rules:
- host: {{ include "helm_lib_module_public_domain" (list . "cluster-map") }}
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: cluster-map
port:
name: http
{{- if (include "helm_lib_module_https_ingress_tls_enabled" .) }}
tls:
- hosts:
- {{ include "helm_lib_module_public_domain" (list . "cluster-map") }}
secretName: {{ include "helm_lib_module_https_secret_name" (list . "ingress-tls") }}
{{- end }}
{{- end }}
{{- if and (eq (include "helm_lib_module_ingress_enabled" .) "true") (eq (include "helm_lib_module_https_mode" .) "CertManager") }}
---
apiVersion: cert-manager.io/v1
kind: Certificate
metadata:
name: cluster-map
namespace: d8-cluster-map
{{- include "helm_lib_module_labels" (list . (dict "app" "cluster-map")) | nindent 2 }}
spec:
certificateOwnerRef: false
secretName: {{ include "helm_lib_module_https_secret_name" (list . "ingress-tls") }}
{{- include "helm_lib_module_generate_common_name" (list . "cluster-map") | nindent 2 }}
dnsNames:
- {{ include "helm_lib_module_public_domain" (list . "cluster-map") }}
issuerRef:
name: {{ include "helm_lib_module_https_cert_manager_cluster_issuer_name" . }}
kind: ClusterIssuer
{{- end }}
{{- if and (eq (include "helm_lib_module_gateway_enabled" .) "true") (eq (include "helm_lib_module_https_mode" .) "CertManager") }}
{{- $issuerName := include "helm_lib_module_https_cert_manager_cluster_issuer_name" . }}
{{- if or (eq $issuerName "letsencrypt") (eq $issuerName "letsencrypt-staging") }}
{{- $issuerName = printf "%s-gateway-%s" $issuerName $moduleGateway.name }}
{{- end }}
---
apiVersion: cert-manager.io/v1
kind: Certificate
metadata:
name: cluster-map-httproute
namespace: d8-cluster-map
{{- include "helm_lib_module_labels" (list . (dict "app" "cluster-map")) | nindent 2 }}
spec:
certificateOwnerRef: false
secretName: {{ include "helm_lib_module_https_secret_name" (list . "httproute-tls") }}
{{- include "helm_lib_module_generate_common_name" (list . "cluster-map") | nindent 2 }}
dnsNames:
- {{ include "helm_lib_module_public_domain" (list . "cluster-map") }}
issuerRef:
name: {{ $issuerName }}
kind: ClusterIssuer
{{- end }}
{{- end }}