Migrating Dubbo 3.0 to Istio Service Mesh: A Step‑by‑Step Cloud‑Native Guide
This article details how to transition a Dubbo 3.0 microservice architecture to an Istio service mesh on Kubernetes, covering code modifications, deployment configurations, sidecar injection, traffic management policies, and verification steps with practical YAML examples and log analysis.
Background
Using Dubbo 3.0 framework for microservice development, the cloud‑native wave prompts migration of Dubbo 3.0 services to an Istio service mesh for traffic management.
Solution Overview
Refactor Dubbo 3 code, mainly service discovery configuration.
Deploy Dubbo 3 applications to Kubernetes.
Enable Istio automatic sidecar injection of Envoy containers to intercept traffic and configure Istio traffic‑management policies.
Dubbo 3 Code Adaptation
Modify dubbo.properties . Ensure dubbo.application.name matches the corresponding Kubernetes service name.
Update service annotations. On the client side, explicitly call the provider with providerBy="xxx" , where xxx is the server’s Kubernetes service name.
Practical Steps
Prepare the basic runtime environment: deploy Kubernetes and Istio.
Create a namespace and enable sidecar automatic injection.
apiVersion: v1
kind: Namespace
metadata:
name: dubbo-demo
labels:
istio-injection: enabledDeploy the Dubbo provider. Provider starts normally; logs show successful registration.
Deployment manifest (v1):
apiVersion: apps/v1
kind: Deployment
metadata:
name: dubbo-samples-mesh-provider-v1
namespace: dubbo-demo
spec:
replicas: 2
selector:
matchLabels:
app: dubbo-samples-mesh-provider
version: v1
template:
metadata:
labels:
app: dubbo-samples-mesh-provider
version: v1
annotations:
sidecar.istio.io/rewriteAppHTTPProbers: "false"
spec:
containers:
- name: server
image: apache/dubbo-demo:dubbo-samples-mesh-provider-v1_0.0.1
imagePullPolicy: Always
ports:
- name: grpc-tri
containerPort: 50052
protocol: TCP
- name: http-health
containerPort: 22222
protocol: TCP
livenessProbe:
httpGet:
path: /live
port: http-health
initialDelaySeconds: 10
periodSeconds: 5
timeoutSeconds: 1
readinessProbe:
httpGet:
path: /ready
port: http-health
initialDelaySeconds: 5
periodSeconds: 5
timeoutSeconds: 2
startupProbe:
httpGet:
path: /startup
port: http-health
failureThreshold: 30
initialDelaySeconds: 10
periodSeconds: 5
timeoutSeconds: 2Deployment manifest (v2) follows the same pattern with version v2:
apiVersion: apps/v1
kind: Deployment
metadata:
name: dubbo-samples-mesh-provider-v2
namespace: dubbo-demo
spec:
replicas: 2
selector:
matchLabels:
app: dubbo-samples-mesh-provider
version: v2
template:
metadata:
labels:
app: dubbo-samples-mesh-provider
version: v2
annotations:
sidecar.istio.io/rewriteAppHTTPProbers: "false"
spec:
containers:
- name: server
image: apache/dubbo-demo:dubbo-samples-mesh-provider-v2_0.0.1
imagePullPolicy: Always
ports:
- name: grpc-tri
containerPort: 50052
protocol: TCP
- name: http-health
containerPort: 22222
protocol: TCP
# probes omitted for brevityService definition (port name must start with grpc for Istio protocol detection):
apiVersion: v1
kind: Service
metadata:
name: dubbo-samples-mesh-provider
namespace: dubbo-demo
spec:
type: ClusterIP
selector:
app: dubbo-samples-mesh-provider
ports:
- name: grpc-tri
port: 50052
targetPort: 50052Deploy the Dubbo consumer. Consumer runs normally; logs show traffic handled by Envoy sidecar.
Consumer deployment manifest:
apiVersion: apps/v1
kind: Deployment
metadata:
name: dubbo-samples-mesh-consumer
namespace: dubbo-demo
spec:
replicas: 1
selector:
matchLabels:
app: dubbo-samples-mesh-consumer
version: v1
template:
metadata:
labels:
app: dubbo-samples-mesh-consumer
version: v1
annotations:
sidecar.istio.io/rewriteAppHTTPProbers: "false"
spec:
containers:
- name: server
image: apache/dubbo-demo:dubbo-samples-mesh-consumer_0.0.1
imagePullPolicy: Always
ports:
- name: grpc-tri
containerPort: 50052
protocol: TCP
- name: http-health
containerPort: 22222
protocol: TCP
env:
- name: POD_NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
# probes omitted for brevityConsumer service:
apiVersion: v1
kind: Service
metadata:
name: dubbo-samples-mesh-consumer
namespace: dubbo-demo
spec:
type: ClusterIP
selector:
app: dubbo-samples-mesh-consumer
ports:
- name: grpc-dubbo
protocol: TCP
port: 50052
targetPort: 50052Inspect Envoy sidecar logs for provider and consumer to verify inbound and outbound traffic handling.
kubectl logs -f -n dubbo-demo dubbo-samples-mesh-provider-v1-... -c istio-proxyLogs show inbound traffic for the provider and outbound traffic for the consumer.
Create traffic‑management rules. A canary release directs 80 % of traffic to the old version and 20 % to the new version.
apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
name: dubbo-samples-mesh-provider
namespace: dubbo-demo
spec:
hosts:
- dubbo-samples-mesh-provider.dubbo-demo.svc.cluster.local
http:
- route:
- destination:
host: dubbo-samples-mesh-provider.dubbo-demo.svc.cluster.local
subset: v1
port:
number: 50052
weight: 80
- destination:
host: dubbo-samples-mesh-provider.dubbo-demo.svc.cluster.local
subset: v2
port:
number: 50052
weight: 20
---
apiVersion: networking.istio.io/v1alpha3
kind: DestinationRule
metadata:
name: dubbo-samples-mesh-provider
namespace: dubbo-demo
spec:
host: dubbo-samples-mesh-provider.dubbo-demo.svc.cluster.local
trafficPolicy:
loadBalancer:
simple: ROUND_ROBIN
subsets:
- name: v1
labels:
version: v1
- name: v2
labels:
version: v2Verify that consumer logs reflect the expected 8:2 traffic split, confirming the canary rule works.
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.
MaGe Linux Operations
Founded in 2009, MaGe Education is a top Chinese high‑end IT training brand. Its graduates earn 12K+ RMB salaries, and the school has trained tens of thousands of students. It offers high‑pay courses in Linux cloud operations, Python full‑stack, automation, data analysis, AI, and Go high‑concurrency architecture. Thanks to quality courses and a solid reputation, it has talent partnerships with numerous internet firms.
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.
