Cloud Native 9 min read

How Lagou Migrated Its Services to UK8S: Key Lessons in Cloud‑Native Transformation

This article details Lagou's migration of production workloads from traditional VMs to UK8S, covering business architecture, stateful container deployment, sidecar log collection, dual monitoring stacks, service exposure strategies, configuration management, CI/CD pipelines, and future plans for autoscaling.

UCloud Tech
UCloud Tech
UCloud Tech
How Lagou Migrated Its Services to UK8S: Key Lessons in Cloud‑Native Transformation

Preface

In March 2019 Lagou began moving production workloads from UHost to UK8S; by September most QA modules were containerized, and all backend management services in production had migrated, with some additional modules also containerized. The migration revealed many challenges but also demonstrated benefits such as higher resource utilization, improved operational efficiency, and faster business iteration due to environment consistency.

Business Architecture

Lagou's current UK8S deployment primarily hosts backend management services, while foundational components remain on UHost. Thanks to UK8S's flat network, Pods and VMs intercommunicate, allowing migration without architectural changes. All containerized services use

StatefulSet

rather than

Deployment

to keep stable pod names for configuration distribution and to simplify troubleshooting via fixed call chains.

Log Collection

Before containerization, logs were written to VM local files. After migration, pod placement is dynamic, so logs would be scattered across VMs. Lagou therefore redirects container logs to a unified logging platform, discarding local storage.

Lagou adopts a sidecar pattern: each business pod runs a Filebeat container sharing an

emptyDir

with the application container; Filebeat collects logs and forwards them to Kafka. This avoids modifying applications to write to stdout/stderr, reduces migration effort, and offers flexibility and tenant isolation compared with a DaemonSet approach.

Monitoring Solution

Lagou uses two monitoring stacks: UCloud‑provided Prometheus for the Kubernetes layer and a self‑developed system for business‑level metrics.

Prometheus monitors nodes (CPU, memory, disk I/O, network, etc.) via

node‑exporter

, core Kubernetes components via their metrics endpoints, and pod resource usage via

cAdvisor

and

kube‑state‑metrics

. The open‑source Kube‑Prometheus project simplifies deployment, and UCloud offers a UK8S‑compatible branch.

For business monitoring, Lagou continues using its own system: applications embed an SDK that reports custom metrics over UDP to a collector, which stores data in OpenTSDB. A Grafana‑like dashboard visualizes the data, and an alerting module triggers notifications when thresholds are exceeded.

Service Exposure / Invocation

Lagou uses UK8S's built‑in LoadBalancer, exposed internally via UCloud's ULB4, for stable service exposure. Internal service calls rely on ZK/Eureka for registration and discovery, unchanged from the VM era.

To ensure reliable inter‑service communication across both container and VM workloads, Lagou deployed CoreDNS in the UHost environment, providing a unified DNS service that resolves domain names for all services, including MySQL, Kafka, Redis, and other foundational components.

Configuration Center

Lagou manages configuration files through a unified configuration center built on a customized version of Baidu Disconf, allowing per‑hostname and namespace distribution. Configuration files are version‑controlled in Git; ConfigMaps are avoided to reduce cluster load and maintain parity with the VM environment.

Continuous Delivery

Lagou operates CI/CD across four environments: development, testing, pre‑release (online verification), and production. Pre‑release and production run on UK8S with namespace isolation for consistency. While a legacy VM‑based release system exists, Kubernetes deployments now use Jenkins pipelines, and the legacy system is being refactored for Kubernetes compatibility.

Next Steps

Lagou is testing Horizontal Pod Autoscaler (HPA) and Cluster Autoscaler (CA) to introduce automatic scaling in production, aiming to lower IT costs and reduce manual scaling effort. Core services such as MySQL, Kafka, and big‑data clusters will remain on UHost, while all other services are slated for gradual migration to UK8S.

monitoringCI/CDKubernetesContainerizationloggingUK8S
UCloud Tech
Written by

UCloud Tech

UCloud is a leading neutral cloud provider in China, developing its own IaaS, PaaS, AI service platform, and big data exchange platform, and delivering comprehensive industry solutions for public, private, hybrid, and dedicated clouds.

0 followers
Reader feedback

How this landed with the community

login Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.