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
+55
View File
@@ -0,0 +1,55 @@
# cluster-map Deckhouse module.
#
# make test unit tests of the app and the hooks
# make lint golangci-lint + dmt
# make render helm template with test values (catches template errors fast)
# make publish VERSION=v0.7.0 [CHANNEL=alpha] build, push and register the module
# make release VERSION=v0.7.0 CHANNEL=stable move a release channel
#
# The registry layout follows deckhouse/modules-actions: <SOURCE>:<module>
# registers the module, <SOURCE>/<module>:<version> is the bundle,
# <SOURCE>/<module>/release:<version|channel> is the release image.
MODULE ?= cluster-map
SOURCE ?= git.project-chimera.ru/fanchji/cluster-map
CHANNEL ?= alpha
BASE_IMAGES_VERSION ?= v2.1.7
CRANE ?= crane
DMT ?= dmt
API_VERSIONS ?= --api-versions autoscaling.k8s.io/v1/VerticalPodAutoscaler --api-versions monitoring.coreos.com/v1/PodMonitor
.PHONY: test lint render base-images build publish release
test:
cd images/cluster-map/src && go test -race -count=1 ./...
cd hooks/batch && go test -count=1 ./...
lint:
cd images/cluster-map/src && golangci-lint run ./...
cd hooks/batch && go vet ./...
$(DMT) lint .
render:
helm template $(MODULE) . --namespace d8-cluster-map $(API_VERSIONS) -f tests/values/default.yaml > /dev/null
helm template $(MODULE) . --namespace d8-cluster-map $(API_VERSIONS) -f tests/values/default.yaml -f tests/values/no-hubble.yaml > /dev/null
@echo render OK
# Deckhouse publishes its base image digests; the same file official modules build from.
base_images.yml:
curl -sfL -o $@ "https://fox.flant.com/api/v4/projects/deckhouse%2Fcontainer-base%2Fbase-images/packages/generic/base_images/$(BASE_IMAGES_VERSION)/base_images.yml"
base-images: base_images.yml
build: base_images.yml
@test -n "$(VERSION)" || (echo "VERSION is required, e.g. VERSION=v0.7.0" && exit 1)
MODULES_MODULE_TAG=$(VERSION) werf build --repo=$(SOURCE)/$(MODULE) --save-build-report --build-report-path images_tags_werf.json
publish: build
$(CRANE) copy "$$(jq -r '.Images.bundle.DockerImageName' images_tags_werf.json)" "$(SOURCE)/$(MODULE):$(VERSION)"
$(CRANE) copy "$$(jq -r '.Images."release-channel-version".DockerImageName' images_tags_werf.json)" "$(SOURCE)/$(MODULE)/release:$(VERSION)"
$(CRANE) append --oci-empty-base --new_layer "" --new_tag "$(SOURCE):$(MODULE)"
$(MAKE) release VERSION=$(VERSION) CHANNEL=$(CHANNEL)
release:
@test -n "$(VERSION)" || (echo "VERSION is required" && exit 1)
$(CRANE) copy "$(SOURCE)/$(MODULE)/release:$(VERSION)" "$(SOURCE)/$(MODULE)/release:$(CHANNEL)"