Cloud Native 11 min read

Implement Full‑Chain Gray Release with Alibaba Cloud MSE and AppStack

This guide walks you through using Alibaba Cloud MSE microservice engine and the Cloud Efficient AppStack platform to set up a gray‑release environment for Spring Cloud applications, covering prerequisite setup, baseline deployment, gray lane creation, pipeline integration, verification, and cleanup.

Alibaba Cloud Native
Alibaba Cloud Native
Alibaba Cloud Native
Implement Full‑Chain Gray Release with Alibaba Cloud MSE and AppStack

Scenario Overview

The article demonstrates a full‑chain gray‑release workflow for three Spring Cloud services (A, B, C) using Alibaba Cloud MSE and Cloud Efficient AppStack. Traffic is first routed through a gateway, then passes sequentially through A → B → C. When new versions of A and C need testing, they are deployed to a gray environment while B remains on the baseline.

Prerequisites

Enable the advanced version of Cloud Efficient (free trial for one month) and turn on the development‑process feature in AppStack.

Activate MSE microservice governance.

Baseline Environment Setup

Import sample code from https://github.com/aliyun/alibabacloud-microservice-demo.git into Cloud Efficient Codeup.

Create four environments in AppStack: test, pre, gray, prod, each linked to appropriate Kubernetes clusters.

Define Kubernetes deployment YAML with placeholders such as {{ .AppStack.image.backend }} for the container image and MSE‑specific labels (e.g., msePilotCreateAppName, msePilotAutoEnable, alicloud.service.tag).

apiVersion: apps/v1
kind: Deployment
metadata:
  name: spring-cloud-a-{{.AppStack.envName}}
  labels:
    run: spring-cloud-a-{{.AppStack.envName}}
    namespace: {{ .Values.namespace }}
spec:
  selector:
    matchLabels:
      app: spring-cloud-a-{{.AppStack.envName}}
  template:
    metadata:
      labels:
        app: spring-cloud-a-{{.AppStack.envName}}
        # MSE gray‑release config
        msePilotCreateAppName: spring-cloud-a
        msePilotAutoEnable: 'on'
        {{ if eq .AppStack.envName "gray" }}
        alicloud.service.tag: gray
        {{ end }}
    spec:
      containers:
      - name: spring-cloud-a
        image: {{ .AppStack.image.backend }}
        imagePullPolicy: Always
        ports:
        - containerPort: 20001
        livenessProbe:
          tcpSocket:
            port: 20001
          initialDelaySeconds: 30
          periodSeconds: 60
        env:
        - name: spring.cloud.nacos.discovery.server-addr
          value: 'nacos-server'  # replace with internal Nacos domain
        - name: dubbo.registry.address
          value: 'nacos://nacos-server:8848'

Creating the Gray Lane

In the MSE governance console, navigate to Full‑Chain Gray Release → Create Lane Group . Choose “MSE Cloud‑Native Gateway” as the entry type, select the gateway, and add A, B, C to the lane group. Then create a lane with the tag gray and a routing rule group=gray.

Integrating Gray Release into AppStack Pipelines

Add a “Gray Environment Deploy” task after the manual approval step in the production stage, selecting the gray environment and the built image.

Add a “Gray Environment Cleanup” task after the production release to delete resources while keeping metadata.

Deploying and Verifying Gray Release

Trigger the production pipelines for A and C; the pipelines first deploy to the gray environment. Verify the deployment by sending a request with the gray identifier, e.g.: curl -X GET http://47.96.xx.xxx/A/a?group=gray The response shows traffic flowing through A‑gray → B → C‑gray. A request without the identifier routes to the baseline environments.

Final Production Release and Cleanup

After successful gray verification, manually trigger the production release to push the new versions to the prod environment. Once the production rollout succeeds, run the gray‑environment cleanup task to destroy gray resources, leaving only the production deployment.

References

Cloud Efficient AppStack documentation

MSE governance guides

GitHub demo repository

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

KubernetesSpring CloudMSE
Alibaba Cloud Native
Written by

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.

0 followers
Reader feedback

How this landed with the community

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.