Architecture / Decision records / ADR-HIS-068
ADR-HIS-068 Deployment topology unit: a catalogue and inventory service, environments as reviewed TOML rendered into what is applied, drift recorded from observation, and a clock guard that removes skewed nodes from Tier 1 service by taint¶
| Status | Accepted |
| Decided | 2026-11-26 by session RC-1-S20 |
| Record | Drafted 2026-11-26; approved 2026-11-30 by the Enterprise Architecture Board |
| Where the rule lives | platform/deployment-topology/ (its README.md; mod-ise-001/; api/topology.v1.openapi.yaml; environments/; bin/topology with lib/topology/; rendered/; ansible/; observability/clock-drift.rules.yaml) |
Context¶
RC-1-S20 builds MOD-ISE-001 for FR-ISE-PLT-001 (hosting and environment isolation), FR-ISE-PLT-002 (service catalogue, tiering, redundant deployment) and FR-ISE-PLT-004 (time integrity). DEC-ISE-002 settles hosting on private cloud at two sites, and DEC-ISE-003 settles RKE2, PostgreSQL, Kafka, OpenBao and the observability stack. The contract of RC-1-S02 (contracts/ise, service-catalogue.v1) fixes the catalogue, environment inventory and drift report that people and the other units read. Its contract point for this session says: serve the inventory and the drift report, publish EnvironmentDriftDetected for each drift found, and feed the Tier 1 redundancy finding (PR-PLT-002-1) into readDependencyGraph.
The specification and the card leave these open:
- who serves the catalogue operations of the contract;
- how the operations the contract lacks are offered: tier approval, retirement, recording an environment's definition, recording a drift check, maintenance windows, the data-load guard;
- where environment definitions live and in what form, and how their version reaches the inventory;
- how drift is found, and where the placement of each service's instances comes from;
- how a node with a skewed clock is removed from Tier 1 service, and from what its offset is read;
- what "an incomplete entry" means when the contract's ServiceDefinition already requires the core attributes.
Decision¶
- The catalogue and inventory service is a Java unit in
platform/deployment-topology, made from the service template (ADR-HIS-044): unitise-deployment-topology, modulemod-ise-001, schemamod_ise_001, topichis.ise.environment.v1. It serves every operation ofservice-catalogue.v1except the service state board (listServiceStates,readServiceState), which platform/observability serves, as the gateways' route model already says. It consumesServiceStateChanged(his.ise.service.v1) as the health telemetry of the availability report. - What the contract lacks is this unit's own API,
api/topology.v1.openapi.yaml, under/v1/topology/. It holds tier approval, retirement and an entry's history; maintenance windows; recording an environment's definition and a drift check; the isolation evidence; the data-load guard; and the clock offset report. An ISE contract session can take these intocontracts/isecompatibly, as ADR-HIS-066 point 3 did for the pipeline. - Admission checks what the schema cannot.
registerServicealready refuses an entry without the attributesServiceDefinitionrequires, an unknown dependency and objectives weaker than the tier's (CFG-ISE-017, CFG-ISE-018).admitServicethen refuses, with one entry per gap: - an entry without an approved tier;
- a Tier 1 entry without alert rules (PR-OBS-001-1), or with an external dependency that does not state whether it needs internet or a third-party control plane, or needs one without an approved exception (BR-ISE-020, PR-PLT-001-3);
- a dependency no longer registered;
- an operating document that does not resolve. With
his.topology.references.resolveeach is fetched; without it, its form is checked.
An admitted entry may change, but not into one that admission would refuse; a changed tier loses its approval until it is approved again.
4. Environments are reviewed TOML in environments/ (sites.toml and one file per environment), checked by bin/topology check before merge and rendered by bin/topology render into rendered/<env>/, which is committed: the inventory record, the Kubernetes base (namespaces labelled with zone and environment, the environment ConfigMap with the training banner and TZ=UTC, the node clock exporter, this unit's workload), the RKE2 settings and the chrony configuration. The build fails when the rendering is stale. A definition reaches the inventory only through bin/topology record, run by the workload that applies it, with its version platform-deployment-topology@<commit> taken from git, refused when uncommitted. The service checks it again with the same rules (Definitions.java), so nothing reaches the inventory that review would refuse. A credential scope or network range shared with another environment is accepted, alerted and flagged for rotation, as section 10 says.
5. Drift is recorded from observation. bin/topology drift compares the rendered objects with what kubectl get -o json reads, on the fields the definition sets, and takes OpenTofu's resource_drift and pending changes from tofu show -json. It records every difference as one drift check, against the definition version the inventory holds. The service makes each new difference an Open finding, published once as EnvironmentDriftDetected and audited. A finding that is gone is Reverted against the same version, or Adopted against a newer one. The same check carries the placements: the ready instances of each service and the availability zones of their nodes. The graph judges PR-PLT-002-1 on these, for admitted Tier 1 services in active Production environments.
6. A site's failure zones are availability zones in sites.toml: rooms with their own power, cooling, uplinks and storage, carried by nodes as topology.kubernetes.io/zone. Production needs two. bin/topology gate is the deployment gate on Kubernetes objects: a workload whose pods are labelled his.cema.care/tier: "1" needs two replicas or more, a zone spread with DoNotSchedule, a disruption budget, readiness probes, a preStop hook, and no toleration of the clock taint.
7. The clock guard reads offsets from Prometheus and acts through a taint. The node exporter's timex collector runs on every node, tolerating every taint, and gives node_timex_offset_seconds and node_timex_sync_status. Every 15 seconds the guard judges each node against CFG-ISE-020: a warning at 100 ms and a critical alert at 500 ms. Beyond 1 s it removes the node from Tier 1 service, until the node is back within 100 ms and synchronized. Removal is the taint his.cema.care/clock-skew=true:NoExecute, with the node excluded from external load balancers. Tier 1 pods do not tolerate the taint (the gate checks this), so they are evicted from the node and their endpoints leave routing; lower tiers tolerate it and stay. The unit's service account may get and patch nodes and nothing else. Prometheus rules alert on the same metrics, and they are tested with promtool. When offsets cannot be read nothing is changed, and a removed node that stops reporting stays removed. Each node patch carries the resourceVersion it was computed from and is retried on a conflict, and the load-balancer label is removed on restoration only if the guard added it. A cycle holds a PostgreSQL advisory lock, so only one replica runs it.
8. Time sources are site infrastructure: two GNSS-disciplined servers per site on a site management network outside every environment's ranges, followed with NTS by every node, with minsources 2 and stepping only at boot (ansible/roles/chrony).
9. The data-load guard is asked before a load (bin/topology load-data runs the load command only when authorized). Synthetic or masked data needs its source named. Unmasked patient data is authorized in Production and DR, and elsewhere only under the approved, unexpired exception the environment's definition carries; Training never. Every answer is recorded, and every refusal is logged and audited before it is answered.
10. Audit of every catalogue change, definition, drift finding, data-load decision and routing change uses ise.config.changed, the D02-ISE 9.5 type for platform configuration, with the action naming what happened.
Consequences¶
- The environment inventory is the reviewed definitions, nothing else: a definition that is not committed cannot be recorded, and the drift report always says against which version the actual state was compared.
- The guard's removal is as strong as the Tier 1 workloads' intolerance of the taint. The gate checks it on the manifests it is given; Tier 1 units' manifests must pass it before Argo CD applies them.
- A guard that can patch nodes is a privileged component. Its permission is limited to nodes, and every change it makes is audited.
- The data-load guard protects the loads that ask it. A database restore or copy that bypasses it is not refused by this unit; the environments' own credentials (behaviour 7) are the other line.
- PR-PLT-002-1 is judged on observation, so a production environment never observed raises no finding until its first drift check.
- The real clusters, sites and time servers do not exist yet. The definitions name synthetic sites and private ranges until the hospital names them.
Alternatives considered¶
- Changing
contracts/iseto add the missing operations. A build session does not change a fixed contract except compatibly, with a record in its handover (session rule 4). The unit's own API keeps the contract as the domain leads approved it. - Environment definitions as OpenTofu. The hosting product under the private cloud is not selected beyond RKE2, so there is no provider to write against. The TOML model renders what is known, and drift already reads OpenTofu's plan when the hosting code is written.
- A node agent that reports its own clock. It would need a credential on every node. The node exporter is unprivileged, reads the kernel's own estimate, and its metrics reach Prometheus anyway.
- Cordoning the node. A cordon stops new scheduling but leaves running Tier 1 pods in routing, and it would affect every tier, not only Tier 1.