Platform Engineering · Lesson 238

Platform Scorecards, SLOs, Cost Allocation, and Deprecation

Once teams depend on a platform, it has to be run like the production system it is. Scorecards show each service's standing against agreed standards (owner, on-call, SLOs, template version, vulnerabilities) and nudge improvement without a ticket. Platform SLOs state what the platform promises its users: pipeline success, deploy time, environment provisioning, portal availability. Guardrails and tenant isolation keep teams sharing a cluster from hurting each other. Cost allocation shows each team what it uses. And lifecycle management retires old versions with notice and help. This lesson follows the platform through one quarter, and shows two failures: scorecards turned into a league table that taught teams to game them, and a deprecation announced with a date and nothing else.

Difficulty: Master · Know this first: Lesson 237, Lesson 234

What you will learn

By the end of this lesson you can work at four levels:

This page teaches it with a plain-language analogy, an animated diagram with normal and failure scenarios, a simulator, a quiz, basic, intermediate, advanced, and master checks, the expert detail ("Go deeper"), a production incident, a hands-on lab with commands and their output, and a production design exercise.

Run it as:

When it breaks, I check

One thing to remember

Where the time goes

This bar adds up hours of platform team effort over a quarter. It is a worked example, not a measurement. The scorecard and deprecation hops decide whether the platform improves services or just creates work.

Try it: run the quarter

Pick how scorecards are used, how costs are shown, and how the old template is retired.

70%services improving for real
−11%cost change
0services broken at switch-off

Check yourself

Three questions. No score is saved anywhere — this is just you against the material.

Basic to master

Running a platform grows in four levels: reading scorecards and SLOs, building them, running shared tenancy and cost, and managing the lifecycle of the platform itself.

Basic — Read scorecards and SLOs

At the basic level you can read your service's scorecard and the platform's SLOs.

  • Your level, the failing checks, and how to fix each.
  • The platform's published SLOs and whether they are met.
  • Your team's monthly cost in the showback report.

Where it breaks: fixing the check instead of the thing it checks.

Try it: Basic

Your scorecard fails "SLO burn alert configured". What is the real fix?

Now do it: Fix one failing scorecard check properly.

Intermediate — Build scorecards and platform SLOs

At the intermediate level you build checks and SLOs from real data.

  • Scorecard levels with checks that read outcomes; each check links to a fix.
  • Platform SLIs from pipeline, provisioning, and portal data; error budgets and burn alerts.
  • Scorecards owned by teams, reported as trends, not rankings.

Try it: Intermediate

How do you count pipeline failures for the platform's SLO?

Now do it: Classify last week's pipeline failures by cause.

Advanced — Tenancy, guardrails, and cost

At the advanced level teams share the platform safely and see their costs.

  • Namespaces with quotas, default-deny network policies, RBAC, and isolation tests.
  • Admission policies for all tenants; exceptions with expiry.
  • OpenCost or Kubecost by namespace, tags for cloud resources; showback before chargeback.

Try it: Advanced

Why showback before chargeback?

Now do it: Publish one month of showback with the method.

Master — Lifecycle of the platform

At the master level the platform evolves without breaking its users.

  • Stages for every capability (alpha, beta, GA, deprecated, retired) with published promises.
  • Deprecations as migration projects: tooling, tracking, help, brown-outs, switch-off at zero usage.
  • Version adoption tracked; old versions retired on a regular cadence so the estate does not fragment.

Trade-off: long deprecation windows are kinder and keep old versions alive longer, which costs the platform team; tooling shortens both.

Try it: Master

What is a brown-out in a deprecation?

Now do it: Plan two brown-outs for a version you want to retire.

Go deeper

A scorecard defined as data, with checks that read outcomes rather than file presence (the shape is tool-neutral; Backstage Tech Insights, Cortex, Port, and OpsLevel have their own formats):

levels:
  bronze:
    - {id: owner,       check: catalog.owner != null}
    - {id: oncall,      check: pagerduty.service_exists(owner)}
    - {id: runbook,     check: runbook.url_resolves and runbook.updated_within_days < 180}
  silver:
    - {id: slo,         check: slo.count >= 1 and slo.burn_alert.fired_in_test_within_days < 90}
    - {id: vulns,       check: scan.critical_open == 0}
    - {id: template,    check: template.minor_behind <= 1}
  gold:
    - {id: restore,     check: backup.restore_test.succeeded_within_days < 90}
    - {id: load,        check: loadtest.peak_ratio >= 1.5 and loadtest.age_days < 120}
    - {id: change_fail, check: dora.change_failure_rate < 0.15}

Kubernetes tenancy for one team's namespace: quotas and a default-deny network policy (allow rules for its own traffic are added per service).

apiVersion: v1
kind: ResourceQuota
metadata: {name: team-quota, namespace: payments-prod}
spec:
  hard: {requests.cpu: "40", requests.memory: 80Gi, limits.memory: 120Gi, pods: "200"}
---
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata: {name: default-deny, namespace: payments-prod}
spec: {podSelector: {}, policyTypes: [Ingress, Egress]}

A deprecation timeline that works: announce with reason and replacement (day 0); migration tool and automated pull requests (day 0–7); weekly tracking of remaining users and direct contact (ongoing); office hours (weekly); brown-outs of 1 hour, then 4 hours (days 60 and 75); switch-off when usage is zero (around day 90), with a documented way back for a week.

One time it broke

This is a composite of a failure pattern that keeps repeating; the details are illustrative. The date that arrived before the migration did.

Timeline

  • Day 0An email announces that the v2 pipeline image will be removed on the 1st of next month. No tool, no tracking of which services use it.
  • Day 0–30Some teams migrate by hand. Others miss the email, or plan to "do it later".
  • Day 31The image is deleted from the registry. 31 services cannot build, two with urgent production fixes waiting.
  • Day 33The image is restored. The deprecation restarts with a catalogue query of users, automated update pull requests, office hours, two brown-outs, and switch-off at zero.

What changed after

The catalogue records template and pipeline image versions for every service, deprecations follow a published runbook, retirement happens when tracked usage is zero, and removed artifacts are kept restorable for a week.

Try it yourself, from scratch

Everything here runs on any Linux machine: your own laptop, WSL on Windows (run wsl --install in PowerShell once), or a small cloud VM. The Python needs only Python 3 and its standard library; check that you have it with python3 --version.

Before you start: A practice cluster: Docker, kind, and kubectl, then kind create cluster. Python 3 for the program.

1. Linux commands

Type each one, read what it prints, and compare it with the note above it.

  1. Create a team namespace with a quota, the basic unit of tenancy.

    Reversible

    kubectl create namespace payments-dev
    kubectl create quota team-quota -n payments-dev --hard=requests.cpu=2,requests.memory=4Gi,pods=10
    kubectl describe quota team-quota -n payments-dev

    Options: --hard sets the limits for the whole namespace.

    Expect: The quota with Used 0 and the hard limits.

    Clean up: kubectl delete namespace payments-dev.

  2. Try to exceed it: a deployment asking for more CPU than the quota allows.

    Reversible

    kubectl create deployment big -n payments-dev --image=nginx:1.27 --replicas=3
    kubectl set resources deploy/big -n payments-dev --requests=cpu=1
    sleep 5; kubectl get rs -n payments-dev -o wide
    kubectl get events -n payments-dev --field-selector reason=FailedCreate -o custom-columns=MSG:.message | head -3

    Expect: Fewer than 3 pods running, and FailedCreate events saying the quota is exceeded: one team cannot take the cluster.

  3. Add a default-deny network policy, the start of network isolation between teams.

    Reversible

    kubectl apply -n payments-dev -f - <<'EOF'
    apiVersion: networking.k8s.io/v1
    kind: NetworkPolicy
    metadata: {name: default-deny}
    spec: {podSelector: {}, policyTypes: [Ingress, Egress]}
    EOF
    kubectl get networkpolicy -n payments-dev

    Expect: The policy listed. kind's default network plugin does not enforce NetworkPolicy; install Calico or Cilium in kind to see traffic actually blocked.

2. Python: platform_quarter.py

This program runs one platform quarter in miniature: it scores services with presence checks and with outcome checks to show how presence checks get gamed, allocates a shared bill to teams by namespace usage for showback, and tracks a deprecation week by week, switching off only when usage reaches zero. Save it as platform_quarter.py, then run it.

# platform_quarter.py
SERVICES = {  # name: what exists, and what actually works
    "ledger":  {"runbook_file": True, "runbook_used_in_drill": True,  "slo_object": True, "burn_alert_fired_in_test": True},
    "search":  {"runbook_file": True, "runbook_used_in_drill": False, "slo_object": True, "burn_alert_fired_in_test": False},
    "checkout":{"runbook_file": True, "runbook_used_in_drill": True,  "slo_object": True, "burn_alert_fired_in_test": True},
    "reports": {"runbook_file": True, "runbook_used_in_drill": False, "slo_object": True, "burn_alert_fired_in_test": False},
}
print("service    presence checks   outcome checks")
for name, s in SERVICES.items():
    presence = s["runbook_file"] + s["slo_object"]
    outcome = s["runbook_used_in_drill"] + s["burn_alert_fired_in_test"]
    print(f"{name:<10} {presence}/2               {outcome}/2")
print()

BILL = 400_000.0
REQUESTS = {"payments": 220, "search": 140, "checkout": 310, "data": 480, "platform-overhead": 50}   # CPU cores requested
total = sum(REQUESTS.values())
print("showback (by requested CPU):")
for team, cores in sorted(REQUESTS.items(), key=lambda kv: -kv[1]):
    print(f"  {team:<18} {cores / total:6.1%}  {BILL * cores / total:>10,.0f} USD")
print()

remaining = 31
week = 0
plan = {2: 6, 3: 5, 4: 5, 6: 4, 8: 3, 9: 2, 10: 3, 11: 2, 12: 1}   # services migrated each week (update pull requests, help)
while remaining > 0:
    week += 1
    remaining -= plan.get(week, 0)
    note = " brown-out (1 h)" if week == 9 else " brown-out (4 h)" if week == 11 else ""
    print(f"week {week:>2}: {remaining:>2} services still on v2{note}")
print(f"week {week}: switch v2 off at zero usage")

Run it, and you should see this output:

$ python3 platform_quarter.py
service    presence checks   outcome checks
ledger     2/2               2/2
search     2/2               0/2
checkout   2/2               2/2
reports    2/2               0/2

showback (by requested CPU):
  data                40.0%     160,000 USD
  checkout            25.8%     103,333 USD
  payments            18.3%      73,333 USD
  search              11.7%      46,667 USD
  platform-overhead    4.2%      16,667 USD

week  1: 31 services still on v2
week  2: 25 services still on v2
week  3: 20 services still on v2
week  4: 15 services still on v2
week  5: 15 services still on v2
week  6: 11 services still on v2
week  7: 11 services still on v2
week  8:  8 services still on v2
week  9:  6 services still on v2 brown-out (1 h)
week 10:  3 services still on v2
week 11:  1 services still on v2 brown-out (4 h)
week 12:  0 services still on v2
week 12: switch v2 off at zero usage

3. What to notice

4. Advanced: every step as one Bash script

The same Linux steps, made into a real script you can keep and run again. It uses the Bash features a production script needs: functions (one per step), an array of step names, arguments to choose steps, a case for options, exit codes recorded for each step, and a trap that prints a summary even when you stop it with Ctrl+C. Make a folder for this lesson (mkdir -p ~/labs/platform-scorecards-slos-and-lifecycle && cd ~/labs/platform-scorecards-slos-and-lifecycle) and save this as lab.sh.

#!/usr/bin/env bash
# The Linux steps of "Platform Scorecards, SLOs, Cost Allocation, and Deprecation", as one script (save it as lab.sh).
#
#   ./lab.sh          run every step, in order
#   ./lab.sh 2 4      run only steps 2 and 4
#   ./lab.sh --list   list the steps
#
# The steps share one shell, so a later step can use what an earlier one set up (a folder,
# a variable, a container): run them all in order the first time. Your own scripts should
# start with "set -euo pipefail"; this one runs teaching commands, and some of them fail on
# purpose, so it records each step's exit code instead of stopping at the first failure.

STEPS=(
  'Create a team namespace with a quota, the basic unit of tenancy.'
  'Try to exceed it: a deployment asking for more CPU than the quota allows.'
  'Add a default-deny network policy, the start of network isolation between teams.'
)

step_1() {
kubectl create namespace payments-dev
kubectl create quota team-quota -n payments-dev --hard=requests.cpu=2,requests.memory=4Gi,pods=10
kubectl describe quota team-quota -n payments-dev
}

step_2() {
kubectl create deployment big -n payments-dev --image=nginx:1.27 --replicas=3
kubectl set resources deploy/big -n payments-dev --requests=cpu=1
sleep 5; kubectl get rs -n payments-dev -o wide
kubectl get events -n payments-dev --field-selector reason=FailedCreate -o custom-columns=MSG:.message | head -3
}

step_3() {
kubectl apply -n payments-dev -f - <<'EOF'
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata: {name: default-deny}
spec: {podSelector: {}, policyTypes: [Ingress, Egress]}
EOF
kubectl get networkpolicy -n payments-dev
}

# print a step that has to be run by hand, instead of running it
by_hand() {
  echo "  (run this one yourself: $1)"
  sed 's/^/    /'
}

RESULTS=()
run_step() {
  local n=$1 start=$SECONDS code
  printf '\n== step %d of %d: %s\n' "$n" "${#STEPS[@]}" "${STEPS[n-1]}"
  "step_$n"
  code=$?
  RESULTS+=("step $n: exit code $code, $((SECONDS - start)) s")
}

summary() {
  echo
  echo "== summary"
  local r
  for r in "${RESULTS[@]}"; do echo "  $r"; done
}

case "${1:-}" in
  -h|--help) sed -n '2,6p' "$0"; exit 0 ;;
  --list) for i in "${!STEPS[@]}"; do echo "$((i + 1)). ${STEPS[i]}"; done; exit 0 ;;
esac

[ $# -eq 0 ] && set -- $(seq 1 "${#STEPS[@]}")
for n in "$@"; do
  if ! [[ $n =~ ^[0-9]+$ ]] || (( n < 1 || n > ${#STEPS[@]} )); then
    echo "there is no step '$n'; try --list" >&2
    exit 2
  fi
done
trap summary EXIT
trap 'echo; echo "stopped with Ctrl+C"; exit 130' INT
for n in "$@"; do run_step "$n"; done

Then make it executable and run it:

chmod +x lab.sh
./lab.sh --list     # the steps
./lab.sh            # every step, then a summary of exit codes and times
./lab.sh 2 3        # only steps 2 and 3

5. Learn the basics behind it

New to a feature used above? These W3Schools pages explain each one from zero, with examples you can run in the browser.

If you remember nothing else

Design exercise

Your platform serves 180 services on shared clusters, has no published SLOs, one big bill, and three template versions in use. Plan the next two quarters.

Clarifying questions to ask

What goes in the scorecard, at which levels, and how is it used? Which platform SLOs do you publish? How are tenants isolated? How are costs allocated and shown? How do you retire the oldest template version without breaking anyone?

Rough sizing

Say 180 services, 25 teams, 4 shared clusters, $400,000 a month of platform cost, and template v1 (12 services), v2 (31), v3 (137).

Shape of the answer

Catalogue completeness first; bronze/silver/gold scorecards with outcome checks, owned by teams and reported as trends; platform SLOs for pipeline success (infrastructure causes), merge to production, provisioning, and portal availability with burn alerts; namespaces with quotas, default-deny policies, RBAC, and weekly isolation tests; OpenCost and tags for showback, chargeback considered after two quarters; v1 retired first with automated update pull requests, tracking, office hours, and brown-outs, then v2 on the same runbook.

Trade-offs to name

Outcome checks are harder to build than presence checks and are the only ones worth having; showback changes behaviour without budget fights; retiring versions costs platform time now and saves far more than supporting three versions indefinitely.

Failure modes and how to troubleshoot them

Each row is one way this system went wrong in the diagram's scenarios. The hop number is where to look first.

ScenarioWhereEffectWhat goes wrong
Scorecards as a league tableHop 2: ScorecardsBreaksScores are published as a ranking and used in performance reviews. Checks look for presence, not substance: a file named runbook.md, an SLO object, a load-test job. Teams add placeholder runbooks and SLOs with targets nobody watches.
Deprecation by date onlyHop 7: Adoption and feedbackDegradesNobody knows which services are still on template v2 or the old pipeline image.
Deprecation by date onlyHop 9: DeprecationBreaksAn email announces that template v2's pipeline image will be removed on the 1st. There is no migration tool and no tracking. On the 1st, the image is removed; 31 services cannot build, including two with urgent fixes waiting.

How to troubleshoot

  1. Write down the symptom and when it started: what users see, which number moved, and what changed just before (a deploy, a config change, traffic).
  2. Walk the path in order, from the first hop to the last: Catalogue → Scorecards → Platform SLOs → Guardrails → Tenant isolation → Cost allocation → Adoption and feedback → Lifecycle → Deprecation. The first hop whose evidence is wrong is where to dig.
  3. At that hop, run the read-only check from the diagram or the lab first; change nothing until the evidence points at a cause.
  4. Fix the smallest thing that restores service, or roll back the last change, and confirm the symptom is gone with the same check.
  5. Write down what you found and the check that would have caught it sooner, so the next person starts there.

References and review

The official documentation and standards behind this lesson. Versions and defaults change; when a command or field here differs from them, trust the official page.

Last updated . Next review due by November 2027. Found something out of date? Tell me.

Saved on this device, in this browser.
Next in this series · Lesson 239
SecOps

SecOps is the team and the system that watches your production systems for attackers and deals with them when they show up. Think of it this way. DevSecOps is about building security into the code before it ships.

Go to Lesson 239 →

Or browse the full course from the Lessons index.