Getting Started with Terraform Infrastructure as Code

Manually logging into cloud consoles to create servers, databases, and networks — this approach barely works when resources are few, but once environments grow complex, you end up unable to modify, clean up, or explain your infrastructure. Infrastructure as Code (IaC) uses code to describe infrastructure, making resource creation, modification, and destruction versionable, reviewable, and reusable. Terraform is currently the most popular IaC tool. This article covers everything from concepts to practice....

April 24, 2024 · 12 mins · 2429 words · XuBaojin

SLO Design in Practice: From Business Goals to Technical Metrics

Overview The first dilemma many teams face when practicing SRE is: they know what an SLO is, but they don’t know how to set one. They either copy Google’s 99.99% or pick an arbitrary 99.9% — only to find that the number neither reflects user experience nor drives engineering decisions. A good SLO isn’t plucked from thin air. It’s derived from business goals through a series of engineering methods: user journey analysis, metric selection, value calibration, multi-tier design, and regular review....

April 24, 2024 · 18 mins · 3637 words · XuBaojin

Commercial vs Self-Hosted Monitoring: Datadog vs Open-Source Solutions

Overview When selecting a monitoring system, one of the most debated questions is “commercial platform or self-hosted open-source.” Datadog is the benchmark for commercial observability platforms — out-of-the-box, feature-complete, with rich integrations, but at a premium price. Prometheus + Grafana represents the open-source self-hosted approach — flexible, controllable, with no license fees, but requiring investment in operations personnel. This isn’t a simple “save money vs save effort” choice. For fast-growing startups, Datadog’s out-of-the-box experience may be more valuable than the license fees saved....

April 17, 2024 · 14 mins · 2978 words · XuBaojin

Grafana Dashboard Best Practices

Grafana is the most popular visualization platform in the cloud-native era, but there’s a world of difference between “functional” and “effective.” A cluttered dashboard leaves on-call engineers lost in a sea of panels, while a well-designed one conveys system health in 5 seconds. This article starts from design principles, covers the variable system, panel selection, and alerting integration, and ties everything together with a complete SLO dashboard. Reference: Grafana Official Documentation...

April 17, 2024 · 8 mins · 1646 words · XuBaojin

K8s Networking Model: CNI and Service Networking

Four Core Requirements of the Kubernetes Networking Model The Kubernetes networking model is built on four core requirements. Understanding them is the foundation for mastering K8s networking. According to the official Kubernetes networking model documentation, these four requirements form the cornerstone of cluster network communication. 1. Pod-to-Pod Communication K8s requires that all Pods can communicate directly via IP without NAT (Network Address Translation). This means: Each Pod has its own IP address Pod-to-Pod communication uses real Pod IPs, without NAT translation Regardless of which Node a Pod is scheduled on, the Pod-to-Pod network remains flat and reachable This is the most fundamental design decision in the K8s networking model....

April 12, 2024 · 7 mins · 1389 words · XuBaojin

Ansible Playbook Best Practices: From Basics to Production

Overview Ansible has a low barrier to entry — a YAML file and a few lines of yum install can get things running. But when you face hundreds of servers, multiple environments, complex dependencies, and strict change audit requirements, the gap between “it runs” and “it’s production-ready” is an entire engineering discipline. This article distills the core practices of production-grade Playbooks into an actionable guide, covering the full chain from structure organization to performance optimization....

April 5, 2024 · 15 mins · 3107 words · XuBaojin

Prometheus PromQL: From Beginner to Expert

PromQL (Prometheus Query Language) is the query language of the Prometheus monitoring system and the core of the cloud-native monitoring stack. Whether you’re building Grafana dashboards, writing alerting rules, or running ad-hoc queries during incident troubleshooting, PromQL is indispensable. This article starts from the data model and progressively covers aggregation operations, common functions, practical queries, and advanced techniques like subqueries. Reference: Prometheus Official Documentation — Querying basics I. PromQL Data Model PromQL has four fundamental data types....

April 4, 2024 · 7 mins · 1294 words · XuBaojin

Disk I/O Performance Diagnosis and Optimization

Introduction Disk I/O is often the slowest link in the system performance chain. A single mechanical disk seek takes about 10ms, while memory access takes only about 100ns — a 100,000x difference. When business applications experience latency jitter or slow response times, the investigation inevitably points to the I/O subsystem. This article starts from the metrics system, combined with hands-on tool usage and production case studies, to build a reusable I/O diagnosis methodology....

March 27, 2024 · 8 mins · 1627 words · XuBaojin

Kubernetes Ingress Controller Selection and Configuration

Overview Kubernetes Service provides Layer 4 load balancing, but in production, most web applications need Layer 7 routing capabilities: domain-based virtual hosting, path-based routing, TLS termination, and canary deployments. Ingress is K8s’s abstraction for Layer 7 routing, and the Ingress Controller is the concrete implementation of this abstraction. Choosing an Ingress Controller is not a small decision—it sits at the entry point of all external traffic. A wrong choice or misconfiguration can impact the availability of the entire cluster’s services....

March 27, 2024 · 11 mins · 2161 words · XuBaojin

Makefile Build Automation: More Than Just Compilation

Overview Many people think of Makefile as merely a build assistant for C/C++. But Make is fundamentally a dependency-driven task execution engine — you tell it “what the target is, what it depends on, and how to generate it,” and it handles executing in the correct order while skipping steps that don’t need repeating. This model is equally powerful in ops scenarios: deployment depends on build, cleanup depends on service shutdown, checks depend on configuration being ready....

March 26, 2024 · 14 mins · 2964 words · XuBaojin