Skip to content

Implementation plan / Session plan / Handover RC-3-S14

Handover RC-3-S14 Build: Platform: deployment topology

Card: RC-3-S14. Issue: cema-care/his#70. Branch: session/RC-3-S14. Slice: RC-3. Decision record: ADR-HIS-106.

What was built and where

Everything is in platform/deployment-topology/, except the decision record, its row in the decision record index, and this handover. It extends what RC-1-S20 built and rebuilds nothing. The unit's README.md, section "Scaling, workload isolation and capacity", has every rule, setting and command.

Scope as read. FR-ISE-PLT-003: performance, scalability, workload isolation and the capacity model, with TEST-ISE-005 and the safety-critical function "Secondary consumer isolation" (D02-ISE 11.1). It also carries the contract point of RC-3-S14 in contracts/ise/README.md: - serve the capacity models and scaling policies of service-catalogue.v1 1.1, from the Kubernetes priority classes, quotas and autoscalers; - Tier 1 runs at least two instances across failure domains, at the highest priority; - the capacity model covers the six areas and starts from the reference workload profile; - raise ise.capacity-action when a forecast passes the threshold.

What was built:

  • Workload isolation, rendered into every environment (lib/topology/scaling.py; rendered/<env>/kubernetes/):
  • six priority classes, tier-1 above all others. Only Tier 1 and Tier 2 preempt; tier-4 is the default of a pod that names none;
  • a ResourceQuota his-lower-tiers per namespace, scoped to the classes tier-3, tier-4, analytics and bulk, from each environment's new [capacity] (cluster size and lowerTierShares, together at most 30%, CFG-ISE-027);
  • the analytics cluster's own RKE2 settings (rke2/analytics-config.yaml), from each environment's new [analyticsScopes]: its cluster, issuer, secrets namespace and database cluster, none of them a transactional credential;
  • one HorizontalPodAutoscaler per scaling policy of the new scaling/policies.toml. It adds instances at once and removes them slowly. This unit's own policy is the first (Tier 2, two to four instances), and its Deployment now takes tier-2 and resources burstable to 1.5 times.
  • The deployment gate (lib/topology/gate.py) now also checks:
  • Tier 1 takes tier-1 with guaranteed resources;
  • Tier 2 bursts to 1.5 times at most;
  • lower tiers state their limits;
  • no workload takes a class above its tier;
  • an autoscaler's minimum counts as the instances of a Tier 1 workload.
  • The capacity model (capacity/reference.toml, lib/topology/capacity.py, rendered/capacity-model.json):
  • the six areas from the reference workload profile of D02-ISE 10.2, with forecasts at 12, 36 and 60 months;
  • bin/topology capacity prints it with the actions it would raise, or publishes it, with measured figures if given.
  • The service (mod-ise-001/.../capacity/, migration V2__capacity_scaling.sql):
  • listCapacityModels, publishCapacityModel, readCapacityModel and approveCapacityModel;
  • capacity actions as tasks ise.capacity-action through workflow.v1 createTask, created once and retried while the task service is down;
  • the review-date gauges;
  • readScalingPolicy and updateScalingPolicy, with the same rules as bin/topology check, versioned under If-Match and audited with before and after. updateScalingPolicy takes only the service identity that applies the merged scaling/policies.toml, and refuses a person;
  • bin/topology scaling records the reviewed policies.
  • Alerts (observability/capacity.rules.yaml, five rules): the scaling limit, the lower-tier quota near full, cluster requests near capacity, p95 near 2 s, and the capacity model's review overdue. test/capacity.rules.test.yaml is their promtool test.
  • The exercise scripts/lib/workload_isolation.py (TEST-ISE-005, AC-02, AC-03, PR-PLT-003-1), and this card's check scripts/ends-when-rc-3-s14.sh.

No dependency was added. The images are those RC-1-S20 pinned: k3s, Python, Prometheus and Node.js.

Checks and their result

The integration environment ran as HIS_SESSION=RC-3-S14 (his-rc-3-s14), light profile, and was reset at the end.

Check Command Result
Unit build and every test ./gradlew build in platform/deployment-topology (step 1 of scripts/ends-when-rc-3-s14.sh) Passed. 101 JUnit tests, 0 failed, 1 skipped (the kit's Kafka adapter test, full profile only, as in the template). The module's 71 include CapacityTest 8, ScalingPolicyTest 6 and the contract test 17. Then topologyChecks: bin/topology check, render --all --check, 63 Python tests, and promtool on the clock drift and capacity rules
Provider contract test contract/ServiceCatalogueContractTest, part of the build his-contract verify contracts/ise on the 16 operations served, the six new ones included: 38 cases, none failed. validate-event of EnvironmentDriftDetected: passed
Deployment gate step 2: bin/topology gate on every environment's desired.json Passed for all five environments
TEST-ISE-005 exercise step 3: scripts/lib/workload_isolation.py Accepted as run by the repository owner (issue #70, 2026-11-30); not rerun. The shared host was overloaded throughout (see below)
Secret scan platform/delivery-pipeline/bin/secret-scan code origin/main HEAD No secret found
Static analysis platform/delivery-pipeline/bin/static-analysis platform/deployment-topology No blocking finding; no clinical artifact
Links, documentation site check_links.py; mkdocs build 0 broken links; the site builds with no new warning

The exercise, as far as it ran. The host (4 CPUs) is shared by three sessions and the CI runners, and ran at a load average of 20 to 60 throughout. Every run was disturbed: - In the cluster, the isolation held in every run. The lower-tier quota admitted 6 of the 12 analytics and bulk pods and refused the others 37 to 42 times. Their CPU stayed within the 30% quota (900m of 3000m requested, 740m to 870m used), and their containers were CFS-throttled. - In the one attempt with a moderate load (host load 13.5), the Tier 1 stand-in answered within AC-01's targets alongside that load: p95 527 ms, p99 811 ms, 0 of 2,401 requests failed. Its baseline alone, at host load 5, was p95 202 ms. - Latencies of the other attempts reflect the host, not the cluster: p95 2.4 s to 7 s with failed requests, at host loads of 19 to 48, with the nodes stalled for CPU up to 45% of the time. - Phases 3 and 4 (scaling, contention for nodes) have not yet run on an undisturbed host.

The exercise now repeats a phase whose nodes stalled for CPU more than 25% of the time, and reports INCONCLUSIVE (exit 2) rather than a pass or a failure when no attempt ran undisturbed.

CPU cap (asked by the repository owner). Both k3s exercises of this unit now cap their cluster: the control-plane node at 1.5 CPUs and each agent at 0.5, at most 2.5 CPUs of the host. They are workload_isolation.py and RC-1-S20's failure_domain.py, through --cpus. Each run removes its cluster when it ends. The exercise's workload is sized to 0.5-CPU nodes.

Requirements and test scenarios

Every test names its requirement, and its test scenario where one exists. Java tests are in platform/deployment-topology/mod-ise-001/src/test/java/care/cema/his/ise/mod001/, Python tests in platform/deployment-topology/test/.

Requirement, criterion or scenario Covered by
Behaviour 1 (instances added and removed without user-visible interruption) test_scaling_capacity.ScalingPolicies...instances_are_added_at_once_and_removed_slowly; the gate's readiness, preStop and grace rules (RC-1-S20); exercise phase 3
Behaviour 2 (high-volume domains scale independently) One autoscaler per service from its own policy (...the_committed_policies_pass_and_render_as_autoscalers); test_render_gate_drift.Drift...instances_the_autoscaler_adds_are_not_drift
Behaviour 3, PR-PLT-003-1, BR-ISE-018, CFG-ISE-027 test_scaling_capacity.Isolation (classes, preemption, 30% quotas); GateIsolation; ScalingPolicyTest.noPriorityAboveTier, tier1Rules; exercise phases 2 and 4
Behaviour 4, section 13 (analytics compute and credentials of its own) Isolation...the_analytics_zone_has_compute_and_credentials_of_its_own, ...an_analytics_credential_of_the_transactional_zones_is_refused
Section 10 "Analytics job targets a clinical transaction store" Isolation...no_flow_lets_analytics_reach_a_clinical_transaction_store (platform/network-protection's allowlist), with the separate credentials above
Behaviour 5 (long-running work asynchronous with visible status) Not this unit's to build for others (see "Differences"). This unit's own long work, the capacity actions, runs asynchronously: CapacityTest.taskServiceDown
Behaviour 6, section 10 "Scaling limit reached" test_scaling_capacity.CapacityRules (promtool: HisScalingLimitReached, HisLowerTierQuotaNearlyFull, HisClusterRequestsApproachCapacity, HisLatencyApproachingTarget). p95 and p99 per service are platform/observability's readPerformanceReport (RC-3-S09)
Behaviour 7, AC-04, NFR-ISE-015, section 9 output CapacityTest.publishedCoversSixAreas, incompleteModelRefused; test_scaling_capacity.CapacityModel...ac_04_*
Inputs (scaling policy: Tier 1 at least two instances across failure domains; Tier 1 priority above all) ScalingPolicyTest.tier1Kept, tier1Rules, validation; test_scaling_capacity.ScalingPolicies
Inputs (workload baseline dated, with source) CapacityTest.incompleteModelRefused (undated baseline); ...measured_workloads_replace_the_assumed_ones
PR-PLT-003-2 CapacityTest.forecastAboveThresholdRaisesAction, currentUseAndStatedActions, taskServiceDown; test_scaling_capacity...a_forecast_above_the_threshold_within_the_horizon_raises_an_action
Section 3 (approval by the Enterprise Architecture Board; the policy decides) CapacityTest.approvalSupersedes, approvalRules; ScalingPolicyTest.policyDecides
Sections 11 and 12 (versioned, review date; audit with before and after) CapacityTest.approvalSupersedes, reviewDate; ScalingPolicyTest.versionedAndAudited; test_scaling_capacity.CapacityRules (HisCapacityModelReviewOverdue)
AC-01 (p95 under 2 s, p99 under 5 s at agreed peak) Exercise phases 1 and 2 for the Tier 1 stand-in, as run (accepted). The system-wide measure at agreed peak is left to RC-3-S24 or the slice gate ("Needs a person")
AC-02 (analytics cannot starve clinical transactions) Exercise phase 2, as run (accepted): the quota held the lower tiers within 30%, and Tier 1 stayed within target in the attempt at moderate load
AC-03 (instances added without failed requests) The autoscaler rendering and its rules (test_scaling_capacity.ScalingPolicies); exercise phase 3 written but not run on an undisturbed host. Left to RC-3-S24 or the slice gate
TEST-ISE-005 Exercise phase 2, as run (accepted): clinical latency within target at moderate load; analytics and bulk throttled (pods the quota refused, their CPU held to the quota, CFS throttling). The system-wide run is left to RC-3-S24 or the slice gate
PR-PLT-003-1 in a running cluster (preemption of lower tiers before Tier 1) The priority classes and their tests (Isolation, GateIsolation); exercise phase 4 written but not run on an undisturbed host. Left to RC-3-S24 or the slice gate
Contract service-catalogue.v1 1.1 contract/ServiceCatalogueContractTest: the six new operations with the ten earlier ones

Safety-critical function: secondary consumer isolation (D02-ISE 11.1). Its control is in two parts: - asynchronous publication and producer independence, which are FR-ISE-EVT-001's (event backbone); - quotas and priority classes, which are FR-ISE-PLT-003's and this card's.

Its verification is "failure injection and load tests". This card runs the load test of its part, the exercise. Phase 2 ran and was accepted as run by the repository owner; phase 4 (preemption) and the system-wide load test are left to RC-3-S24 or the slice gate. The failure injection of billing and analytics consumers during bedside transactions is TEST-ISE-018, FR-ISE-EVT-001's. This card builds the specified control and changes no existing one, so it makes no hazard log entry.

Non-functional targets: - NFR-ISE-005, security: - fail closed on the decision point; - only a person approves a capacity model; - analytics credentials kept apart; - capacity telemetry and models with no patient data; - the lower-tier stand-ins, the client and the Tier 1 stand-in run under Pod Security restricted. - NFR-ISE-009, interoperability: the provider contract test; Kubernetes, Prometheus and workflow.v1 formats as they are. - NFR-ISE-012, observability: the template's correlation and telemetry; the metrics his_capacity_model_approved, his_capacity_model_review_overdue, his_capacity_actions_raised_total, his_capacity_action_task_failures_total, his_scaling_policy_changes_total and his_capacity_model_changes_total; ALERT capacity action and ALERT capacity model review overdue log lines; the five rules. - NFR-ISE-016, time integrity: every record is a UTC instant or a date; review and due dates are calendar dates in UTC. - NFR-ISE-018, localization: no screen. The capacity model view is UI-ISE-005's (RC-3-S21).

Differences from the card or specification

  • Threshold and planning horizon of PR-PLT-003-2. D02-ISE section 13 sets neither. They are settings with the defaults 80% and 12 months (ADR-HIS-106 point 6). This is a technical setting, not clinical, financial or access behaviour, so it was decided, not asked; the owner may change it.
  • A rejected capacity model stays Draft. The contract has no Rejected status (ADR-HIS-106 point 7). The rejection, with its reason, is audited, and the version can no longer be approved.
  • quota of a scaling policy is the resources of one instance: requests, and for Tier 1 also limits (ADR-HIS-106 point 5). It is required for Tiers 1 and 2. minInstances 0 is refused, because scaling to zero is not offered.
  • Capacity model approval and scaling policy changes are audited as ise.config.changed, as RC-3-S03 Q3 left it.
  • AC-01 at system level. "Common interactive actions at agreed peak load" needs every unit deployed at agreed peak. This session measures a Tier 1 stand-in on a k3s cluster in Docker, as RC-1-S20 did for TEST-ISE-003. The latencies are those of a small, shared host. They show the isolation; they are not the sizing of production. The system-wide run is under "Needs a person".
  • Behaviour 5 (long-running work asynchronous with visible status) binds every domain's operations, not the platform's alone. This unit provides the isolation (bulk class and quotas) such work runs under.
  • Analytics refused at the network is platform/network-protection's allowlist, which this unit reads in a test and does not change.
  • The forecast is computed by bin/topology, not by the service. The contract takes forecasts as input; the service judges them (PR-PLT-003-2).

Decision by the repository owner

The session was blocked on the exercise, because the host was overloaded (issue #70). On 2026-11-30 the repository owner decided to accept the exercise as run (issue #70, comment 7268762418). The evidence is: - the quota refused the extra analytics and bulk pods, and the lower tiers stayed within 30% CPU; - Tier 1 latency was within target in the attempt at moderate load: p95 527 ms, p99 811 ms, no failed requests.

The exercise was not rerun. The system-wide AC-01 / TEST-ISE-005 load test, with the scaling and preemption phases of AC-03 and PR-PLT-003-1, is left to RC-3-S24 or the slice gate, in an environment without other load.

The decision record was renumbered from ADR-HIS-105 to ADR-HIS-106, because open pull request #257 takes ADR-HIS-105.

Review round 1

  • The pipeline's build of this unit failed in the kit's HttpPolicyDecisionClientTest (Permit and Deny read as an outage). The test gave the client a 300 ms timeout, and the first calls of a cold client on the loaded self-hosted runner took longer. The test is unchanged since RC-1-S20, and this branch did not touch the kit.
  • Fix: this unit's copy now takes the fix platform/observability made in RC-3-S09: a 2 s timeout for the tests of how answers are read, and a late answer at 4 s for the timeout case. The kit's code and the 250 ms of CFG-ISE-031 are unchanged.

Review round 2

  • Who changes a scaling policy. Section 3 lets the Platform Engineer / SRE create and update scaling policies through a reviewed change, and a Domain Service Team only propose scaling parameters for its own services. updateScalingPolicy let any permitted person write a policy directly, and the follow-up asked the decision service to grant it to a Domain Service Team. A policy written that way would also be recorded but never applied, because the autoscalers are rendered from scaling/policies.toml.
  • Fix (ADR-HIS-106 point 4): updateScalingPolicy now takes a service identity only, the workload that applies the merged file with bin/topology scaling, as recordEnvironmentDefinition does. A person is refused with 403 before anything is read or written. The reviewed change is the pull request to scaling/policies.toml: the SRE's change, or a Domain Service Team's proposal for its own services, approved in review. So the record is always the policy in force. This follows section 3 as written, so nothing was asked. The decision service follow-up now grants .update to that identity alone. New test: ScalingPolicyTest.onlyTheReviewedChange (the SRE and a Domain Service Team are refused, and nothing is audited). The provider contract test calls updateScalingPolicy with the applying workload's token.
  • AC-03, PR-PLT-003-1 and the safety verification. The owner's decision on #70 explicitly includes "the scaling and preemption phases of AC-03" in the system-wide run it leaves to RC-3-S24 or the slice gate. That run is also the load-test half of the verification of "Secondary consumer isolation". Where it lands: the RC-3 gate lists TEST-ISE-005 (FR-ISE-PLT-003) among its tests, and RC-3-S24 runs NFR-ISE-004 (verified by "capacity tests; autoscaling validation") and sends any shortfall to the gate. Until then, AC-03 and PR-PLT-003-1 have no passing test in a running cluster: only the rule tests (Isolation, GateIsolation, ScalingPolicies). This is restated on issue #70 and stays under "Needs a person".

Questions for a person

None blocks this session. Under "Needs a person" in the pull request:

  1. ADR-HIS-106, for the Enterprise Architecture Board, with its two technical calls:
  2. the threshold of 80% and the planning horizon of 12 months of PR-PLT-003-2, which D02-ISE section 13 does not set;
  3. a rejected capacity model stays Draft and cannot be approved, because the contract has no Rejected status.
  4. The system-wide AC-01 / TEST-ISE-005 run (owner of the session plan), left to RC-3-S24 (NFR-ISE-004) or the RC-3 gate (its TEST-ISE-005 row; RC-3-E2E-006) in an environment without other load. Until it passes, AC-03, PR-PLT-003-1 and the load-test verification of "Secondary consumer isolation" are open. It covers every unit's common interactive actions at agreed peak, with analytics and bulk load alongside, and the scaling and preemption phases of AC-03 and PR-PLT-003-1. scripts/ends-when-rc-3-s14.sh step 3 can be run there as it is.
  5. The first capacity model (Enterprise Architecture Board): rendered/capacity-model.json is the planning model from the reference workload profile. It is to be published and approved once the service runs in production, and replaced by measured figures at the latest three months after go-live (D02-ISE 10.2).

Follow-ups outside the card

  • Every unit's manifests:
  • take the priority class of its tier and the resources of CFG-ISE-027 (Tier 1 guaranteed, Tier 2 within 1.5 times, lower tiers with limits), or the gate refuses them;
  • add the unit's scaling policy to scaling/policies.toml here when its manifests are deployed, and leave replicas to the autoscaler.
  • Observability (platform/observability):
  • import observability/capacity.rules.yaml in rules.json, as ADR-HIS-097 does for the clock-drift rules, and write the runbooks its rules name;
  • scrape kube-state-metrics in every cluster;
  • show the capacity model on UI-ISE-005 (RC-3-S21).
  • D10 decision service (services/ess-runtime-decision):
  • grant ise.capacity-model.read to engineering, operations and governance;
  • grant .publish to the Platform Engineer / SRE, and .approve to the Enterprise Architecture Board;
  • grant ise.scaling-policy.read broadly, and .update to the applying workload's service identity only (his-topology-applier). People change or propose a policy by a pull request to scaling/policies.toml, so no person is granted .update.
  • D10 workflow service: register the task type ise.capacity-action and the queue ise.platform-engineering. Give this unit's service identity createTask for them.
  • Development realm (FN-S02): the synthetic users dev.eab-chair (Enterprise Architecture Board) and dev.platform-sre, if the RC-3 scenario uses them.
  • Gateways (platform/gateways): route the new paths /v1/capacity-models and /v1/services/{id}/scaling-policy here. Shed requests from the lowest-priority clients first when a limit is reached (section 10, "requests shed from lowest-priority workloads first"): that is the gateways' rate limiting.
  • Follow-ups of RC-3-S09 to this unit (Wazuh manifests, the intake's Service, bin/wazuh-apply) are not FR-ISE-PLT-003. They stay open for a later card on this unit.
  • Real clusters: set each environment's [capacity] from the actual nodes. Run the exercise on RKE2 in pre-production, and replace the reference figures with measured ones.