service-mesh
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseService Mesh
服务网格
Implement service-to-service communication management.
实现服务间通信管理。
Istio Installation
Istio 安装
bash
istioctl install --set profile=demobash
istioctl install --set profile=demoEnable sidecar injection
启用 sidecar 注入
kubectl label namespace default istio-injection=enabled
undefinedkubectl label namespace default istio-injection=enabled
undefinedTraffic Management
流量管理
yaml
apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
name: myapp
spec:
hosts:
- myapp
http:
- match:
- headers:
canary:
exact: "true"
route:
- destination:
host: myapp
subset: canary
- route:
- destination:
host: myapp
subset: stable
weight: 90
- destination:
host: myapp
subset: canary
weight: 10yaml
apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
name: myapp
spec:
hosts:
- myapp
http:
- match:
- headers:
canary:
exact: "true"
route:
- destination:
host: myapp
subset: canary
- route:
- destination:
host: myapp
subset: stable
weight: 90
- destination:
host: myapp
subset: canary
weight: 10mTLS
mTLS
yaml
apiVersion: security.istio.io/v1beta1
kind: PeerAuthentication
metadata:
name: default
spec:
mtls:
mode: STRICTyaml
apiVersion: security.istio.io/v1beta1
kind: PeerAuthentication
metadata:
name: default
spec:
mtls:
mode: STRICTBest Practices
最佳实践
- Enable strict mTLS
- Implement circuit breakers
- Use traffic shifting for deployments
- Monitor with Kiali and Jaeger
- 启用严格模式mTLS
- 实现断路器
- 为部署使用流量切换
- 借助Kiali与Jaeger进行监控