How to Quickly Roll Back Spring Cloud Apps on Kubernetes with EDAS
This article explains practical methods for rolling back Spring Cloud applications on Kubernetes, covering configuration, code, and workload rollbacks, using EDAS features, Kubernetes commands, ACM, Flagger, and the Open Application Model to minimize user impact.
Rollback Scenarios
Rollback of in‑application configuration (e.g., database connections, business rules). If the application supports dynamic config loading, a simple config rollback suffices; otherwise a restart is required.
Rollback of application code version, which means reverting the container image and restarting the workload.
Rollback of workload and operational configuration (infrastructure layer).
Configuration Rollback
Store configuration in a versioned central store such as Alibaba Cloud ACM. ACM provides one‑click rollback, gray release, and audit capabilities.
Code Rollback via Deployment
Kubernetes natively supports Deployment rollbacks.
kubectl rollout undo deployment.v1.apps/my-app
kubectl rollout history deployment.v1.apps/my-app
kubectl rollout undo deployment.v1.apps/my-app --to-revision=3EDAS‑Based Rollback
EDAS adds a UI layer on top of native Kubernetes rollback. During a release, the pipeline can be interrupted and a one‑click rollback performed. EDAS also supports batch, canary, and gray releases with per‑batch monitoring (system metrics, application health, anomaly detection) to trigger rollback automatically.
Post‑Release Rollback
EDAS retains up to ten previous deployment versions. Users can select a historic version and roll back via the console.
Automatic Rollback with Flagger
Flagger (https://github.com/weaveworks/flagger) monitors health checks and predefined metrics (CPU, load, memory) and can trigger a rollback without human intervention.
Workload & Operational Config Rollback via OAM
The Open Application Model (OAM) defines a unified delivery model with three core concepts:
Component : a service or microservice (e.g., MySQL, Spring Cloud provider).
Trait : operational features such as autoscaling rules or Ingress configuration.
ApplicationConfiguration : assembles components and traits into a runnable application.
Example OAM ApplicationConfiguration (YAML) that declares a Spring Cloud provider component with a manual scaler trait:
apiVersion: core.oam.dev/v1alpha2
kind: ApplicationConfiguration
metadata:
name: springcloud-provider-deployment
annotations:
version: v1.0.0
description: "Description of this deployment"
spec:
components:
- componentName: springcloud-provider-component
parameterValues:
- name: PARAMETER_NAME
value: SUPPLIED_VALUE
- name: ANOTHER_PARAMETER
value: "AnotherValue"
traits:
- name: manualscaler.core.oam.dev
version: v1
spec:
replicaCount: 3
scopes:
- scopeRef:
apiVersion: core.oam.dev/v1alpha2
kind: NetworkScope
name: example-vpc-networkStoring these ApplicationConfiguration files in a version‑controlled system (Git, ACM) enables one‑click rollbacks of the entire application stack in EDAS.
OAM project: https://oam.dev/
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.
