Incident Management and On-Call Mechanism Design

Overview There’s a saying in SRE: “Systems will fail — the question is whether you’ll be woken up by them or actively managing them.” Incident management is not “dealing with things after they break” — it’s a complete engineering system spanning prevention, detection, response, and learning. This article systematically covers how to build a practical on-call system across five dimensions: incident grading, on-call rotation, incident response processes, postmortem culture, and alert governance....

August 23, 2024 · 13 mins · 2559 words · XuBaojin

Kubernetes Autoscaling: HPA/VPA/CA Deep Dive

Overview Autoscaling is one of Kubernetes’ most attractive capabilities—scale up when traffic arrives, scale down when it leaves, ensuring service quality while controlling costs. But “automatic” doesn’t mean “mindless.” Poorly configured autoscaling can cause: delayed scaling leading to service degradation, aggressive scale-down disrupting long connections, and flapping scaling wasting resources. K8s autoscaling consists of three layers plus an event-driven extension: Layer Component Scaling Dimension Trigger Pod horizontal HPA Pod replica count CPU/memory/custom metrics Pod vertical VPA Pod resource quotas CPU/memory historical usage Node Cluster Autoscaler Node count Pending Pods Event-driven KEDA Pod replica count Event sources (Kafka/Redis/…) Based on Kubernetes v1....

August 19, 2024 · 13 mins · 2692 words · XuBaojin

Alerting Strategy Design: From Noise to Signal

Overview Alerting is the “last mile” of a monitoring system — and the hardest to get right. A common predicament: servers run dozens of alerting rules generating hundreds of alert notifications daily. On-call engineers, bombarded by WeChat/DingTalk/email, gradually become desensitized — truly urgent alerts are drowned in noise until customer complaints reveal the system has been broken for hours. The golden rule of SRE: every alert must have a clear action....

August 19, 2024 · 14 mins · 2928 words · XuBaojin

Jenkins Pipeline as Code in Practice

Overview Pipeline as Code is the watershed moment when Jenkins evolved from “drag-and-drop configuration” to “code-driven.” Defining pipelines in a Jenkinsfile under Git version control means every pipeline change has a diff to review, a history to trace, and a branch to roll back. This article systematically covers Pipeline as Code practices, from Jenkinsfile syntax to production-grade pipeline design. Reference: Jenkins Pipeline Official Documentation I. Jenkinsfile Syntax 1.1 Declarative vs. Scripted Jenkins Pipeline has two syntax styles:...

July 29, 2024 · 17 mins · 3551 words · XuBaojin

Eliminating Toil: SRE's Approach to Managing Operational Work

Overview The Google SRE Book contains a frequently cited principle: SRE teams should spend no more than 50% of their total work time on toil. This principle seems simple, but in practice, many SRE teams’ toil ratio far exceeds 50% — some even reach 80% or more. Why should SRE take “toil” so seriously? Because toil is the invisible killer of reliability: Toil consumes enormous amounts of time, leaving engineers no energy for work that genuinely improves reliability Toil typically involves manual operations that are error-prone, actually introducing new incidents Toil leads to burnout and attrition of talented engineers Toil doesn’t scale — when the system grows 10x, toil grows 10x too This article systematically covers how to manage operational work across toil definition and identification, source analysis, automation elimination paths, the 50% cap principle, measurement and tracking methods, and team practices....

July 24, 2024 · 17 mins · 3598 words · XuBaojin

cgroup v2 Complete Guide: From Architecture Principles to Production Practices

Overview In today’s era of cloud-native and containerized technologies, Linux cgroups (control groups) serve as the kernel-level foundation for resource isolation and limiting. From Docker container memory limits to Kubernetes Pod CPU Requests/Limits, the underlying mechanism relies on cgroups. However, cgroup v1’s multi-hierarchy architecture, inconsistent controller behavior, and confusing thread model have caused numerous operational headaches in production. cgroup v2, as a complete reimagining of v1, adopts a unified hierarchy architecture that fundamentally addresses v1’s design flaws....

July 23, 2024 · 23 mins · 4791 words · XuBaojin

Kubernetes Operator Development Guide

Overview A Kubernetes Operator is a pattern that packages the operational knowledge of a specific application (like deployment, scaling, backup, recovery) into automated controller software. Instead of manually editing YAML or running kubectl commands, Operators monitor custom resources and automatically reconcile the cluster toward the desired state. This guide provides a deep dive into Operator development—from CRD design principles and Controller reconciliation loops to operator-sdk/kubebuilder hands-on development, testing, and release....

July 23, 2024 · 17 mins · 3507 words · XuBaojin

Prometheus High Availability and Federation

Overview Prometheus defaults to a single-node architecture, which is a dangerous liability in production environments. A single Prometheus instance going down means your entire monitoring system goes blind — you can’t see any metrics during the failure, and alerts stop working because rules are no longer evaluated. As data volume grows to the limits of a single machine’s storage and processing capacity, you’ll face write timeouts, slow queries, and disk exhaustion....

July 23, 2024 · 13 mins · 2659 words · XuBaojin

GitOps Workflow: ArgoCD in Practice

GitOps Core Principles GitOps is a modern continuous delivery methodology introduced by Weaveworks in 2017. It uses Git as the Single Source of Truth for infrastructure and application configuration, achieving continuous deployment through declarative practices. According to the ArgoCD documentation, GitOps follows four core principles: 1. Declarative System Infrastructure and application configurations are stored in Git as declarative descriptions (YAML/Helm/Kustomize): # Example Git repository structure infra-repo/ ├── apps/ │ ├── frontend/ │ │ ├── deployment....

July 22, 2024 · 8 mins · 1690 words · XuBaojin

Capacity Planning and Elastic Scaling in Practice

Overview Capacity planning is a core SRE responsibility. The Google SRE Book treats capacity planning as “proactive work,” emphasizing data-driven forecasting over experience-based guessing. A team without capacity planning either gets crushed by traffic during peaks or wastes significant resource costs during valleys. This article systematically covers capacity planning engineering practices across four dimensions: metric collection, data modeling, Kubernetes elastic scaling configuration, and pitfall avoidance. For a systematic methodology on capacity planning, see Google SRE Book - Capacity Planning and its discussion of capacity planning and cascading failures....

June 27, 2024 · 10 mins · 1970 words · XuBaojin