Skip to content

Architecture / Decision records / ADR-HIS-106

ADR-HIS-106 Workload isolation and capacity: six priority classes with Tier 1 above all and lower tiers never preempting, lower-tier quotas scoped by priority class within 30% of the cluster, scaling policies reviewed as files and rendered as autoscalers, and a capacity model whose actions become tasks

Status Accepted
Decided 2026-11-30 by session RC-3-S14
Record Drafted 2026-11-30; approved 2026-11-30 by the Enterprise Architecture Board
Where the rule lives platform/deployment-topology/ (lib/topology/scaling.py, lib/topology/capacity.py, lib/topology/gate.py; scaling/policies.toml, capacity/reference.toml, the [capacity] and [analyticsScopes] of environments/*.toml; mod-ise-001/.../capacity/, V2__capacity_scaling.sql; observability/capacity.rules.yaml; README.md, "Scaling, workload isolation and capacity")

Context

RC-3-S14 builds FR-ISE-PLT-003 on the deployment topology unit of ADR-HIS-068. The requirement covers several things: - stateless services scale horizontally, without user-visible interruption; - quotas and priority classes keep lower-tier, analytical and bulk work from starving Tier 1 and Tier 2 (BR-ISE-018, PR-PLT-003-1); - the analytics zone has its own compute and credentials; - a capacity model covers six areas, is approved by the Enterprise Architecture Board, and raises capacity actions (PR-PLT-003-2).

It carries a control of the safety-critical function "Secondary consumer isolation" (D02-ISE 11.1). The contracts of RC-3-S03 (ADR-HIS-085) give this unit six operations of service-catalogue.v1 1.1. CFG-ISE-027 sets the isolation by tier: - Tier 1: highest priority, guaranteed resources; - Tier 2: burstable to 1.5 times; - Tiers 3 and 4: lowest priority, within 30% of the shared cluster together; - analytics: a cluster of its own.

To be settled: - the priority classes, and how the 30% is enforced; - where a scaling policy is decided, and how it reaches Kubernetes; - what the contract's quota of a scaling policy means; - the threshold and planning horizon of PR-PLT-003-2, which section 13 does not set; - what a rejected capacity model becomes, since the contract has no Rejected state.

Decision

  1. Six priority classes, Tier 1 above all. The classes are tier-1 (1000000), tier-2 (900000), tier-3, tier-4, analytics and bulk, one for each value of the contract's priorityClass.
  2. Only tier-1 and tier-2 preempt. Lower classes never preempt: they wait. So under contention lower-priority work is preempted before Tier 1, and never the other way round (PR-PLT-003-1).
  3. tier-4 is the globalDefault, so a pod that names no class never runs above Tier 4.
  4. No service takes a class above its tier. A Tier 1 service takes tier-1.
  5. The 30% is a ResourceQuota per namespace, scoped by priority class. Each environment states its application cluster's allocatable CPU and memory, and each namespace's share for Tier 3 and 4 work (lowerTierShares, in percent; at most 30 in total, checked before merge).
  6. Each namespace gets the quota his-lower-tiers, scoped to tier-3, tier-4, analytics and bulk. It caps their requests and their limits.
  7. So lower tiers cannot use more than their share of CPU, and work beyond it is not admitted.
  8. Namespaces stay per domain, as ADR-HIS-068 has them. Services of several tiers can share one, because the scope is the priority class, not the namespace.
  9. The analytics zone has scopes of its own. Each environment names the analytics cluster, its service account issuer, its secrets namespace and its database cluster (analyticsScopes).
  10. None may be a transactional credential of any environment.
  11. bin/topology renders the analytics cluster's RKE2 settings with its own networks and issuer.
  12. The refusal of section 10 ("analytical access to OLTP") is platform/network-protection's allowlist, which has no flow from the analytics zone to the data or recovery zone; a test reads it.
  13. Scaling policies are reviewed files, rendered as autoscalers and recorded in the service. scaling/policies.toml holds each service's policy, changed by pull request (section 3: through a reviewed change).
  14. bin/topology check and the service's updateScalingPolicy apply the same rules: the inputs of FR-ISE-PLT-003 and point 1.
  15. bin/topology render writes one HorizontalPodAutoscaler per policy. It adds instances at once and removes one a minute after five minutes of lower load (behaviour 1).
  16. The autoscaler owns the replica count of a workload it scales, so the Deployment states none. The deployment gate counts the autoscaler's minimum, and drift does not count the instances it adds.
  17. bin/topology scaling records each policy in the service under If-Match, where it is audited with its values before and after.
  18. updateScalingPolicy takes a service identity only, the workload that applies the merged policies, as recordEnvironmentDefinition does; a person is refused (403). Section 3 lets the Platform Engineer / SRE change a policy through a reviewed change, and a Domain Service Team only propose for its own services: both are a pull request to scaling/policies.toml, approved in review. So the service's record is always the policy applied to Kubernetes, and no change bypasses the review.
  19. quota is the resources of one instance. For Tier 1 it is both requests and limits: guaranteed, as CFG-ISE-027 has it. For Tier 2 it is the requests, and the deployment gate holds limits to 1.5 times them. A service's ceiling is its maximum instances times its quota.
  20. The gate also checks every workload with a tier label:
    • Tier 1 takes tier-1 with requests equal to limits;
    • Tier 2 states requests and limits within 1.5 times;
    • lower tiers state limits, which their quota counts;
    • no workload takes a class above its tier.
  21. PR-PLT-003-2: threshold 80%, planning horizon 12 months, by setting. Section 13 sets neither value. 80% is the usual planning threshold for shared infrastructure. 12 months is longer than the lead time of hardware for a private cloud, and covers four quarterly reviews (REP-ISE-013).
  22. Both values are settings (his.topology.capacity.threshold-percent, planning-horizon).
  23. When a version is published, an action is raised for every area whose use now, or forecast within the horizon, is above the threshold, unless the publisher stated one for that area.
  24. Each action becomes a task ise.capacity-action in queue ise.platform-engineering (IF-ESS-010), keyed by version and area so that it is created once. When the task service is down, the action is kept and tried again.
  25. A rejected capacity model stays Draft for good. The contract's statuses are Draft, Approved and Superseded.
  26. A rejection needs its reason and is audited. The version cannot be approved afterwards: the revision is published as a new version, as a version is published once.
  27. Approval is by a person, and supersedes the approved version. One approved version at a time is a database constraint.
  28. The capacity model starts from the reference workload profile. capacity/reference.toml holds the six areas with capacity, current use and kind:
  29. a rate area grows with load;
  30. an accumulating area holds what is retained.

The source is the planning demand of D02-ISE 10.2, with its 2x headroom and 10% a year, until measured. bin/topology capacity --measured replaces current use with measured figures.

Alternatives considered

  • Namespaces by tier (his-adm-tier1, …) with plain namespace quotas. Rejected: a unit holds modules of several tiers (ADR-HIS-096), and the namespaces of ADR-HIS-068 carry zone labels that network policies use. Quotas scoped by priority class give the same isolation without moving workloads.
  • Scaling policies only in the service, applied to Kubernetes by a controller of this unit. Rejected: it would give the service write access to every workload, against ADR-HIS-068's rule that the guard may patch nodes only. It would also put production changes outside review. The reviewed file and Argo CD keep FR-ISE-PLT-001's "through reviewed infrastructure-as-code only".
  • A Rejected status. Rejected: it is not in the contract (session rule 4), and a version marked rejected but kept Draft answers the same need.
  • Raising the action only on approval. Rejected: a forecast above the threshold is the trigger of PR-PLT-003-2, whatever the Board decides about the model. Waiting for approval would delay the action by the approval's time.

Consequences

  • Every unit's manifests must take their tier's priority class and resources to pass the gate. A unit adds its scaling policy to scaling/policies.toml when its manifests are deployed (follow-up to every unit).
  • Lower-tier pods must state limits, or the namespace quota refuses them.
  • The lower-tier shares and cluster capacities are planning figures until the clusters exist. They are changed in the environment files by review.
  • Alerts on approach to limits are Prometheus rules of this unit, imported by platform/observability (ADR-HIS-097). They read kube-state-metrics, which platform/observability must scrape.
  • The threshold and horizon are this record's. If D02-ISE section 13 later sets them, the settings change, not the code.