Star ๅކๅฒ่ถ‹ๅŠฟ
ๆ•ฐๆฎๆฅๆบ: GitHub API ยท ็”Ÿๆˆ่‡ช Stargazers.cn
README.md

SRE Intro โ€” Site Reliability Engineering Fundamentals

labs bonus exam focus duration

A hands-on elective course that teaches how to build and operate reliable systems using Site Reliability Engineering practices. You work on a provided microservice application (QuickTicket) and progressively add observability, SLOs, CI/CD, GitOps, progressive delivery, chaos experiments, and database resilience โ€” ending with an interview-ready portfolio project.

"Hope is not a strategy." โ€” Google SRE motto


Course Roadmap

The course follows a build โ†’ observe โ†’ define โ†’ automate โ†’ deliver โ†’ alert โ†’ break โ†’ recover โ†’ review progression. Each week builds on the previous.

WeekLabModuleKey Topics & Technologies
1Lab 1SRE Philosophy & Systems ThinkingSRE vs DevOps, reliability as a feature, error budgets, toil; Docker Compose; failure exploration
2Lab 2ContainerizationDockerfiles, image layers, container lifecycle, multi-service Compose
3Lab 3Monitoring, Observability & SLOsPrometheus, Grafana, golden signals, SLIs, SLOs, error budgets, recording rules
4Lab 4Kubernetesk3d (k3s in Docker), Deployments, Services, probes, resource limits; Helm (bonus)
5Lab 5CI/CD & GitOpsGitHub Actions, ghcr.io, ArgoCD, GitOps pull model, git revert rollback
6Lab 6Alerting & Incident ResponseGrafana Alerting, SLO burn-rate alerts, runbooks, blameless postmortems
7Lab 7Progressive DeliveryArgo Rollouts, canary with AnalysisTemplate, automated abort, in-cluster Prometheus
8Lab 8Chaos Engineering & ResilienceHypothesis-driven experiments, fault injection, partial failure, weakest-link analysis
9Lab 9Stateful Services & DB ReliabilityAlembic migrations, pg_dump backup/restore, RTO/RPO, PVC + automated CronJob backups
10Lab 10SRE Portfolio & Reliability ReviewLocust in-cluster load tests, DORA metrics, toil identification, capstone review
โ€”Lab 11Advanced Microservice Patterns (bonus)Adds a 4th service; retries with backoff, circuit breaker, rate limiter
โ€”Lab 12Advanced K8s Resilience (bonus)PodDisruptionBudgets, graceful shutdown (preStop), zero-downtime CREATE INDEX CONCURRENTLY

The Project: QuickTicket

A 3-service ticket reservation system. You don't build the app; you make it reliable. (Lab 11 adds a 4th service as an exercise in the bonus track.)

graph LR
    U[User] -->|HTTP| GW[gateway :8080]
    GW -->|HTTP| EV[events :8081]
    GW -->|HTTP| PAY[payments :8082]
    GW -. fire-and-forget, Lab 11 .-> NOT[notifications :8083]
    EV --> PG[(PostgreSQL)]
    EV --> RD[(Redis)]

    style GW fill:#4CAF50,color:#fff
    style EV fill:#2196F3,color:#fff
    style PAY fill:#FF9800,color:#fff
    style NOT fill:#607D8B,color:#fff
    style PG fill:#9C27B0,color:#fff
    style RD fill:#F44336,color:#fff
ServiceRoleStateLanguage
gatewayAPI router, timeouts, Lab 11 resilience patternsStatelessPython 3.13 / FastAPI
eventsTickets, reservations, ordersPostgreSQL + RedisPython 3.13 / FastAPI
paymentsMock payment processor, tunable failuresStatelessPython 3.13 / FastAPI
notificationsMock notifier (Lab 11)StatelessPython 3.13 / FastAPI

All services expose Prometheus metrics (*_requests_total, *_request_duration_seconds) and emit structured JSON logs.

Built-in fault injection via environment variables โ€” no extra tools needed for chaos:

VariableServiceEffect
PAYMENT_FAILURE_RATE=0.3payments30% of charges return 500
PAYMENT_LATENCY_MS=2000paymentsEvery charge takes 2s+
NOTIFY_FAILURE_RATE=0.5notifications (Lab 11)Half of notifies return 500
NOTIFY_LATENCY_MS=300notifications (Lab 11)Injected notify latency
DB_MAX_CONNS=3eventsTiny connection pool, exhausts under load
GATEWAY_TIMEOUT_MS=3000gatewayGateway gives up after 3s

Lectures

Each lecture is 17-25 slides, 340-520 lines of Markdown. Readings 11-12 are self-study (no slide format, pure prose: 400-500 lines each).

#TitleSlidesFile
1SRE Philosophy: From Hope to Engineering23lec1.md
2Containerization: Packaging for Reliability22lec2.md
3Monitoring, Observability & SLOs22lec3.md
4Kubernetes & Helm: From Compose to a Cluster16lec4.md
5CI/CD & GitOps: Automating the Path to Production22lec5.md
6Alerting & Incident Response20lec6.md
7Progressive Delivery: Canary Deployments18lec7.md
8Chaos Engineering: Break Things on Purpose18lec8.md
9Stateful Services & DB Reliability20lec9.md
10SRE Portfolio: Pulling It All Together19lec10.md
R11Reading โ€” Advanced Microservice Patterns473reading11.md
R12Reading โ€” Advanced Kubernetes Resilience408reading12.md

Technology Stack

All tools are free and open-source (or have a free tier). Versions are pinned to the latest stable as of April 2026.

CategoryToolVersionIntroduced
Application runtimePython + FastAPI + uvicorn3.13 / 0.136 / 0.44Week 1 (provided)
ContainersDocker + ComposeDocker 28.xWeek 1
DatabasePostgreSQL17-alpineWeek 1 (provided)
Cache / KVRedis7-alpineWeek 1 (provided)
MetricsPrometheusv3.11.2Week 3 (docker-compose); Week 7 (in-cluster)
DashboardsGrafana13.0.1Week 3
Kubernetesk3d (k3s in Docker)v1.33Week 4
Packaging (optional)Helm 3โ€”Week 4 (bonus only)
CI/CDGitHub Actions + ghcr.ioโ€”Week 5
GitOpsArgoCDv3.3.xWeek 5
AlertingGrafana Alertingโ€”Week 6
Progressive DeliveryArgo Rolloutsv1.9.xWeek 7
DB MigrationsAlembic1.18Week 9
Load TestingLocust2.43Week 10

Kubernetes is introduced in Week 4 and used for every subsequent lab โ€” labs do not ship docker-compose-based alternatives after that point.

๐Ÿ“ก On "observability stack" scope: the course uses Prometheus + Grafana only. Tempo/Loki are mentioned in lectures as adjacent tooling you'd add in a production stack, but aren't deployed. Services expose plain Prometheus metrics (no OpenTelemetry SDK).


What Ships vs What Students Produce

The course repo ships only lab specs, lecture notes, and the application. Students generate the infra layer per lab in their own fork:

PathShips in repoStudents produce
app/ (gateway, events, payments, seed.sql, loadgen/)โœ…
lectures/โœ…
labs/labN.mdโœ…
labs/labN/*.yaml, labs/lab10/locustfile.py โ€” plumbing for labs that needs a fileโœ…
monitoring/grafana/ (provisioning + golden-signals dashboard skeleton)โœ…
monitoring/prometheus/prometheus.yml โ€” students write in Lab 3โœ…
k8s/*.yaml โ€” students write in Lab 4, evolve through Lab 12โœ…
.github/workflows/ci.yml โ€” students add in Lab 5โœ…
migrations/ + alembic.ini โ€” alembic init in Lab 9โœ…
app/notifications/ โ€” students add in Lab 11 (bonus)โœ…
locustfile.py at repo root โ€” copied from labs/lab10/ in Lab 10โœ…
submissions/ โ€” lab reports, one per weekโœ…

The .gitignore enforces the split so student artifacts don't accidentally get pushed to the course repo.

Provided lab-asset files (plumbing โ€” not the lab's learning objective):

FilePurposeUsed in
labs/lab7/prometheus.yamlIn-cluster Prometheus with pod-SD + rollouts-pod-template-hash โ†’ rs_hash relabelLab 7 Bonus, 8, 10, 12
labs/lab7/analysis-template.yamlAnalysisTemplate with initialDelay + safe numerator fallback for canary error-rateLab 7 Bonus
labs/lab7/loadgen.yamlIn-cluster curl loop hitting /events + /healthLab 7
labs/lab8/mixedload.yamlIn-cluster curl loop hitting the full checkout chainLabs 8, 9, 10, 11, 12
labs/lab9/backup-storage.yamlPVC + backup-inspector Deployment for DB backupsLab 9 Bonus
labs/lab10/locustfile.pyLocust scenario (list/reserve/health mix, spread across events 3+5)Lab 10
labs/lab10/locust-runner.yamlJob template for running Locust in-clusterLab 10

Lab Structure

Each lab in weeks 1-10 caps at 12 pts = 10 main + 2 bonus.

TaskPointsDescriptionRequired?
Task 16 ptsCore step that advances the project. Future labs depend on it.Yes
Task 24 pts (3 in Lab 1)Deeper dive into the week's topic. Skippable โ€” won't affect future labs.No
Task 31 ptLab 1 only โ€” GitHub community engagement.Lab 1
Bonus Task2 ptsExtension for motivated students (flat 2 pts each, no difficulty weighting).No

A student who only completes Task 1 across all 10 labs still ends up with a fully working SRE portfolio project.

Bonus labs (11 + 12) have a tighter shape: Task 1 (4 pts) + Task 2 (4 pts) + Bonus Task (2 pts) = 10 pts total (vs main labs' 12). The labs are bonus-track in the sense that they're not on the critical path; the Bonus Task inside each lab is still the genuinely-challenging extension. Bonus labs count toward a separate 20% weight (see grading below).

Submission Workflow

graph LR
    A["Fork Repo"] --> B["Create Branch<br/>feature/labN"]
    B --> C["Complete Tasks"]
    C --> D["Write<br/>submissions/labN.md"]
    D --> E["Push & Open PR"]
    E --> F["Submit PR URL<br/>via Moodle"]
    F --> G["Receive Feedback"]

    style A fill:#4CAF50,color:#fff
    style E fill:#F44336,color:#fff
    style F fill:#00BCD4,color:#fff

Submissions are CLI output + brief analysis, not source code. Paste the commands you ran and what they printed; answer the questions at the end of each task in 2-3 sentences.


Grading

The final grade is composed from five components. Their max contributions add up to 139% but the grade is capped at 100% โ€” meaning multiple paths to A exist, no single path is required, and no point ever goes to waste.

ComponentRaw PointsWeightWhat it rewards
Main labs 1-10 (Task 1 + Task 2 + Task 3-where-applicable)10070%Diligent project work โ€” the floor for any serious student
Bonus tasks 1-10 (2 pts each, flat โ€” no difficulty weighting)2014%Going above and beyond on weekly topics
Quiz leaderboards (5 rolling per-2-labs leaderboards, top-10 share 1% pool each)โ€”up to 5%Engagement + excellence; rewards late-joining students too
Bonus labs 11 + 12 (Task 1 + Task 2 + Bonus = 10 pts each)2020%Mastering advanced microservice + K8s resilience patterns
Final examโ€”30%Optional path โ€” written, comprehensive
Sum (capped at 100%)139%

What this produces in practice

Two real paths to A (โ‰ฅ90%):

  • Practice path: all main labs + bonuses + at least one bonus lab โ†’ โ‰ฅ90%. No exam required.
  • Exam path: all main labs + bonuses + decent exam โ†’ โ‰ฅ90%. No bonus labs required.
  • Doing both caps at 100% with a comfortable buffer for missed points elsewhere.

Sample scores:

ProfileMainL-bonusBonus labsExamQuizTotal
All Task 1 only, nothing else42%0%0%0%0%42%
All Task 1+2, no bonuses, no exam70%0%0%0%0%70%
Add all weekly bonuses70%14%0%0%0%84%
+ good quiz70%14%0%0%5%89% โ† just short of A
+ finish one bonus lab70%14%10%0%5%99% โ† A territory
+ both bonus labs70%14%20%0%5%100% (capped)
Or take the exam instead70%14%0%25%5%100% (capped)
Coast (Task 1 only + lucky quiz)42%0%0%0%5%47%

The deliberate design: Main + lab-bonuses + quiz alone tops out at 89% โ†’ just short of A. To earn A you must do at least one bonus lab OR the exam. That stops the "easy A from quiz padding" pattern.

Quiz leaderboards (the 5%)

Five rolling windows, one per pair of labs:

WindowLabs covered
1labs 1-2
2labs 3-4
3labs 5-6
4labs 7-8
5labs 9-10

Each window allocates a 1% pool to its top 10 students. Rough split: #1 = 0.30%, #2 = 0.20%, #3-5 = 0.10% each, #6-10 = 0.04% each. Maxing all 5 leaderboards at #1 = 1.5% โ€” practically capped around 1-2% for top performers, who are unlikely to win every window. Late-joining students can still rank in later windows without being structurally disadvantaged.

Performance tiers

GradeRangeRequired to reach
A90-100All main labs + at least one of: bonus labs / exam (multiple paths)
B75-89Main labs + most bonuses, no extension work
C60-74Main lab Task 1 across most labs
D0-59Below expectations

Late submissions

Max 6/12 per lab if submitted within 1 week of deadline. No credit after 1 week.


Required Software

Core (all weeks)
  • Git, Docker, Docker Compose
  • A terminal (bash/zsh)
  • Text editor with Markdown support
Per-week additions
WeekAdd
4k3d, kubectl (client v1.33 to match the k3s server)
4 (bonus)helm
5GitHub account (free), a classic PAT with read:packages for ghcr.io
7kubectl argo rollouts plugin (install to ~/.local/bin, no sudo needed)
9Python 3.13 + pip for running Alembic on the host (connects via kubectl port-forward svc/postgres 5432:5432)
10Locust (pip install locust==2.43.4) โ€” optional, since the lab runs Locust in-cluster

Repository Structure

SRE-Intro/
โ”œโ”€โ”€ README.md                 # This file
โ”œโ”€โ”€ .gitignore                # Keeps student artifacts out of the course repo
โ”‚
โ”œโ”€โ”€ app/                      # QuickTicket source (ships)
โ”‚   โ”œโ”€โ”€ gateway/              #   API router
โ”‚   โ”œโ”€โ”€ events/               #   Tickets / reservations
โ”‚   โ”œโ”€โ”€ payments/             #   Mock payment processor
โ”‚   โ”œโ”€โ”€ docker-compose.yaml   #   Compose stack for Labs 1-3
โ”‚   โ”œโ”€โ”€ seed.sql              #   Initial events rows
โ”‚   โ””โ”€โ”€ loadgen/              #   Bash load generator (Labs 1-3)
โ”‚
โ”œโ”€โ”€ docker-compose.monitoring.yaml   # Prometheus + Grafana for Lab 3 (ships)
โ”‚
โ”œโ”€โ”€ monitoring/
โ”‚   โ”œโ”€โ”€ grafana/              # Golden-signals dashboard skeleton + provisioning (ships)
โ”‚   โ””โ”€โ”€ prometheus/           # (students write prometheus.yml in Lab 3)
โ”‚
โ”œโ”€โ”€ lectures/                 # 10 lectures + 2 bonus readings (ships)
โ”‚   โ”œโ”€โ”€ lec1.md ... lec10.md
โ”‚   โ””โ”€โ”€ reading11.md, reading12.md
โ”‚
โ”œโ”€โ”€ labs/                     # Lab specs (ship)
โ”‚   โ”œโ”€โ”€ lab1.md ... lab12.md
โ”‚   โ”œโ”€โ”€ lab7/                 # Provided assets for Lab 7 (prometheus, analysis-template, loadgen)
โ”‚   โ”œโ”€โ”€ lab8/                 # mixedload.yaml
โ”‚   โ”œโ”€โ”€ lab9/                 # backup-storage.yaml
โ”‚   โ””โ”€โ”€ lab10/                # locustfile.py, locust-runner.yaml
โ”‚
โ”‚โ”€โ”€ k8s/                      # (students write from Lab 4 onward)
โ”‚โ”€โ”€ .github/workflows/        # (students add in Lab 5)
โ”‚โ”€โ”€ migrations/               # (students init via Alembic in Lab 9)
โ”‚โ”€โ”€ locustfile.py             # (students copy from labs/lab10/ in Lab 10)
โ””โ”€โ”€ submissions/              # (students write one report per lab)

Key Books & Resources

BookAuthor(s)Why
Site Reliability EngineeringBeyer, Jones, Petoff, Murphy (Google, 2016)The original SRE book. Free at sre.google
The Site Reliability WorkbookGoogle (2018)Practical companion with exercises. Free at sre.google
Implementing Service Level ObjectivesAlex Hidalgo (O'Reilly, 2020)The definitive guide to SLIs, SLOs, and error budgets
AccelerateForsgren, Humble, Kim (IT Revolution, 2018)DORA metrics โ€” what predicts high-performing engineering teams
Chaos EngineeringRosenthal & Jones (O'Reilly, 2020)Principles of controlled failure injection
Release It!Michael Nygard (2nd ed., 2018)Stability patterns โ€” circuit breaker, bulkhead, timeouts
Database Reliability EngineeringCampbell & Majors (O'Reilly, 2017)The DBRE bible
Official documentation
Incident / postmortem

Course Completion

By Week 10 you'll have:

  • A working QuickTicket deployment on k3d with 5 replicas of the gateway, Postgres on a PVC, ArgoCD-driven GitOps, Argo Rollouts canary with automated analysis, in-cluster Prometheus, and an SLO-based alerting config.
  • Lab reports documenting: failure exploration, SLO definition, CI/CD setup, an incident response with postmortem, 3 chaos experiments, a backup/restore cycle with measured RTO/RPO, Locust load tests identifying the system's breaking point, and a capstone reliability review.
  • If you did the bonus labs: a 4th microservice with in-code retries + circuit breaker + rate limiter, and a production-grade K8s resilience story (PDBs, graceful shutdown, zero-downtime migrations).

This is exactly the portfolio you'd walk through in an SRE interview โ€” see the 5-minute walkthrough script in submissions/lab10.md (produced in Lab 10 capstone).

ๅ…ณไบŽ About

๐Ÿš€ SRE intro elective โ€” 10 hands-on labs + 2 bonus operating QuickTicket microservices: SLO-driven observability (Prometheus/Grafana/Loki/Tempo), Kubernetes, GitOps with ArgoCD, alerting & incident response, progressive delivery with Argo Rollouts, chaos engineering, and DB reliability.
argo-rolloutsargocdchaos-engineeringcourseeducationfastapigitopsgrafanahands-on-labskuberneteslokiobservabilityprometheussite-reliability-engineeringslosretempo

่ฏญ่จ€ Languages

Python89.5%
Shell8.4%
Dockerfile2.0%

ๆไบคๆดป่ทƒๅบฆ Commit Activity

ไปฃ็ ๆไบค็ƒญๅŠ›ๅ›พ
่ฟ‡ๅŽป 52 ๅ‘จ็š„ๅผ€ๅ‘ๆดป่ทƒๅบฆ
32
Total Commits
ๅณฐๅ€ผ: 25ๆฌก/ๅ‘จ
Less
More

ๆ ธๅฟƒ่ดก็Œฎ่€… Contributors