Migrating Spring Cloud Microservices to UK8S for Scalable Cloud‑Native Operations
This article details how the Chinese travel platform “要出发” transformed its Spring Cloud‑based micro‑service architecture to a UK8S‑powered Kubernetes environment, introducing Spring Cloud Kubernetes discovery, Prometheus JVM monitoring, HPA‑driven autoscaling, Elastic APM tracing, and Istio service governance to achieve higher elasticity, observability, and operational efficiency.
Why UK8S?
Spring Cloud is a mainstream micro‑service framework that provides intelligent routing, circuit breaking, and service discovery, but its multiple components raise the learning curve and hinder gray‑release and elastic scaling for peak‑traffic scenarios. To overcome these limits, the team evaluated self‑built K8S clusters with Kubespray but chose the managed UK8S platform for its seamless integration with internal UHost, ULB, and UDisk services, built‑in Cluster Autoscaler, and native CNI connectivity.
Overall Business Architecture Changes
Replace Eureka with Spring Cloud Kubernetes discovery. The Kubernetes ETCD stores service information, eliminating the need for a separate Eureka registry.
Replace Feign load balancing with Spring Cloud Kubernetes Ribbon. Ribbon can operate in Service or Pod mode, leveraging native Kubernetes load balancing and Istio for traffic management.
Edge‑gateway refactoring. The original gateway is deployed as a micro‑service inside Kubernetes and traffic is managed by Istio, removing the need for separate gateway code and circuit‑breaker components.
Unify distributed configuration to Apollo. Apollo provides centralized configuration management with real‑time push, permission control, and workflow governance.
Add Prometheus‑based JVM monitoring. Metrics such as response time, request count, JVM memory, GC, and miscellaneous parameters are collected to support HPA‑driven scaling.
Prometheus‑Based JVM Monitoring
After migrating to Kubernetes, the team still needed low‑level JVM metrics. Prometheus, together with its Spring Cloud exporter, provides real‑time monitoring of JVM parameters, enabling precise performance analysis and supporting HPA decisions.
HPA‑Driven Peak Elastic Scaling
The platform experiences traffic spikes during ticket‑booking promotions. Standard HPA based on CPU/memory is insufficient for Java workloads because JVM memory is not released to the host. By exposing the
http_server_requests_seconds_countmetric from Prometheus and converting it to a Kubernetes‑compatible metric, the system dynamically adjusts pod replicas to match request load, while UK8S’s Cluster Autoscaler provisions additional node resources as needed.
Elastic APM‑Based Tracing
To trace requests across multiple services written in different languages, the team adopted Elastic’s open‑source APM stack. Logs are collected via Filebeat, metrics via Metricbeat, and traces via apm‑server, all stored in Elasticsearch, providing a unified view of logging, metrics, and tracing.
Istio Service Governance
Istio was chosen for its security, observability, continuous deployment, and multi‑cloud support. Key components include:
Istio‑gateway: Ingress gateway handling north‑south traffic with TLS termination.
Mesh gateway: Virtual gateway enabling east‑west traffic between sidecars.
Traffic management: Service routing, version‑based canary releases, load‑balancing policies, and rate limiting via DestinationRule, MenQuota, and RedisQuota.
Telemetry: Prometheus‑driven metrics for success rates, traffic direction, peak loads, and dynamic topology visualization.
Conclusion
All “云客赞” social‑commerce apps have been migrated to UK8S, supporting Java, PHP‑FPM, NodeJS, etc. Integrated CI/CD accelerates service iteration, while comprehensive logging, monitoring, tracing, and alerting enable rapid fault isolation. HPA and Istio provide automatic scaling and traffic management, reducing resource costs and improving stability. Future work includes enriching CI/CD pipelines with testing, code scanning, performance testing, and adopting ChatOps and multi‑cloud Istio management.
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.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.