Step‑by‑Step Guide to Building Full‑Link Gray Release with MSE on Kubernetes
This article explains how to enable full‑link gray release for microservices using Alibaba Cloud MSE, covering the underlying technologies, product features, environment preparation, Kubernetes deployment manifests, lane configuration, Ingress routing, traffic verification, and monitoring, all without modifying application code.
Overview
Full‑link gray release is a core capability for microservice architectures, allowing selective routing of traffic to gray (test) environments while keeping the rest on the stable baseline. Implementing this manually across RPC, MQ, databases, caches, and observability requires significant effort, which MSE (Microservice Engine) automates.
Technical Domains Involved
RPC: routing between microservices (Spring Cloud, Apache Dubbo, Service Mesh)
MQ: shadow topics for load testing and isolated traffic
Database: shadow tables for load testing, write‑blocking in high‑availability scenarios
Redis: shadow keys for cache isolation
Distributed task scheduling: gray tasks run on gray machines
Frontend: handling inconsistent page data across customers
Observability: monitoring traffic flow and escape detection
MSE Full‑Link Gray Release Solution
The professional edition of MSE provides a productized solution covering RPC, MQ, and observability. It works with Spring Cloud or Dubbo applications without any code changes, using a Java Agent for bytecode enhancement that supports five years of framework versions.
Traffic isolation lanes : Define lane rules to “color” traffic and route it to gray machines.
Stable baseline environment : Unmarked applications run the production version; gray versions are introduced via lane rules.
One‑click dynamic traffic switching : Create, modify, or delete lane rules in real time.
Observability : Lane‑level metrics show traffic flow and escape situations.
Step‑by‑Step Usage
1. Prepare the Environment
Enable MSE Governance Professional Edition in the console (upgrade from the basic edition if needed).
Install the ack-ingress-nginx component via the Container Service Marketplace, selecting the kube-system namespace.
2. Deploy Demo Applications
Save the following manifest as ingress-gray-demo-deployment-set.yaml and apply it:
# A application base version
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: spring-cloud-a
spec:
replicas: 2
selector:
matchLabels:
app: spring-cloud-a
template:
metadata:
annotations:
msePilotCreateAppName: spring-cloud-a
labels:
app: spring-cloud-a
spec:
containers:
- name: spring-cloud-a
image: registry.cn-shanghai.aliyuncs.com/yizhan/spring-cloud-a:0.1-SNAPSHOT
ports:
- containerPort: 20001
env:
- name: JAVA_HOME
value: /usr/lib/jvm/java-1.8-openjdk/jre
---
# A application gray version
apiVersion: apps/v1
kind: Deployment
metadata:
name: spring-cloud-a-new
spec:
replicas: 2
selector:
matchLabels:
app: spring-cloud-a-new
template:
metadata:
annotations:
alicloud.service.tag: gray
msePilotCreateAppName: spring-cloud-a
labels:
app: spring-cloud-a-new
spec:
containers:
- name: spring-cloud-a-new
image: registry.cn-shanghai.aliyuncs.com/yizhan/spring-cloud-a:0.1-SNAPSHOT
ports:
- containerPort: 20001
env:
- name: JAVA_HOME
value: /usr/lib/jvm/java-1.8-openjdk/jre
---
# B and C applications (base and gray) follow the same pattern (omitted for brevity)Each application (A, B, C) has a base and a gray deployment.
3. Create Services for Base and Gray Versions
apiVersion: v1
kind: Service
metadata:
name: spring-cloud-a-base
spec:
ports:
- name: http
port: 20001
targetPort: 20001
selector:
app: spring-cloud-a
---
apiVersion: v1
kind: Service
metadata:
name: spring-cloud-a-gray
spec:
ports:
- name: http
port: 20001
targetPort: 20001
selector:
app: spring-cloud-a-new4. Create Lane Group and Lanes in MSE Console
In the MSE Governance console, navigate to Microservice Governance > Full‑Link Gray . Create a lane group selecting the microservice namespace (A, B, C). Then create individual lanes, assigning application tags and linking them to the corresponding Ingress rules.
5. Configure Ingress Rules
Define two host rules to route traffic to the base and gray services:
apiVersion: networking.k8s.io/v1beta1
kind: Ingress
metadata:
name: spring-cloud-a-base
spec:
rules:
- host: www.base.com
http:
paths:
- path: /
backend:
serviceName: spring-cloud-a-base
servicePort: 20001
---
apiVersion: networking.k8s.io/v1beta1
kind: Ingress
metadata:
name: spring-cloud-a-gray
spec:
rules:
- host: www.gray.com
http:
paths:
- path: /
backend:
serviceName: spring-cloud-a-gray
servicePort: 200016. Verify Traffic Routing
Use curl with the appropriate Host header to confirm routing:
curl -H"Host:www.base.com" http://{ingress-ip}/a
# Expected flow: A[base] → B[base] → C[base]
curl -H"Host:www.gray.com" http://{ingress-ip}/a
# Expected flow: A[gray] → B[gray] → C[gray]7. Observe Monitoring Data
In the Full‑Link Gray page, select the lane group and view traffic charts for individual applications or the entire lane group to detect traffic escape or performance issues.
Conclusion
MSE’s full‑link gray release capability currently supports RPC, MQ, and observability, with plans to add more scenarios such as XXL‑JOB. The solution enables zero‑code, low‑cost adoption of gray releases, providing seamless traffic isolation, dynamic switching, and comprehensive observability for microservice systems.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
Alibaba Cloud Native
We publish cloud-native tech news, curate in-depth content, host regular events and live streams, and share Alibaba product and user case studies. Join us to explore and share the cloud-native insights you need.
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.
