istio单网格多集群架构搭建完成后,需要验证下当前集群是否可以发现对端集群,验证方法如下:
命名空间建议设置为:demo-dubbo
deploy.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
finalizers:
- kubebuilder.io/net.traffic
labels:
app: helloworld
version: v1
name: helloworld-v1
namespace: demo-dubbo
spec:
progressDeadlineSeconds: 600
replicas: 1
revisionHistoryLimit: 10
selector:
matchLabels:
app: helloworld
version: v1
strategy:
rollingUpdate:
maxSurge: 25%
maxUnavailable: 25%
type: RollingUpdate
template:
metadata:
annotations:
sidecar.istio.io/inject: "true"
sidecar.istio.io/logLevel: debug
sidecar.istio.io/proxyCPU: "0.1"
sidecar.istio.io/proxyCPULimit: "1.0"
sidecar.istio.io/proxyMemory: 128.0Mi
sidecar.istio.io/proxyMemoryLimit: 512.0Mi
creationTimestamp: null
labels:
app: helloworld
inject: "true"
version: v1
spec:
containers:
- image: 10.10.102.113:8443/service-mesh/helloworld:v1
imagePullPolicy: IfNotPresent
name: helloworld
ports:
- containerPort: 5000
protocol: TCP
resources:
limits:
cpu: 100m
memory: 100Mi
requests:
cpu: 100m
memory: 100Mi
terminationMessagePath: /dev/termination-log
terminationMessagePolicy: File
dnsPolicy: ClusterFirst
restartPolicy: Always
schedulerName: default-scheduler
securityContext: {}
terminationGracePeriodSeconds: 30
tolerations:
- operator: Exists
svc.yaml
apiVersion: v1
kind: Service
metadata:
labels:
app: helloworld
name: helloworld
namespace: demo-dubbo
spec:
ipFamilies:
- IPv4
ipFamilyPolicy: SingleStack
ports:
- name: http-http-http-http
port: 5000
protocol: TCP
targetPort: 5000
- name: http-http-end
port: 6000
protocol: TCP
targetPort: 6000
selector:
app: helloworld
sessionAffinity: None
type: ClusterIP
配置完成后,最好重启应用pod和istiod、东西向网关。
=======================================================
以下内容可忽略:
vs和dr可以不配置
vs.yaml
apiVersion: networking.istio.io/v1beta1
kind: VirtualService
metadata:
annotations:
manager: kubebuilder.io/net.traffic
name: helloworld
namespace: demo-dubbo
spec:
http:
- name: cap-baseline
route:
- destination:
host: helloworld.demo-dubbo.svc.cluster.local
subset: cap-baseline
dr.yaml
apiVersion: networking.istio.io/v1beta1
kind: DestinationRule
metadata:
name: helloworld
namespace: demo-dubbo
spec:
host: helloworld.demo-dubbo.svc.cluster.local
subsets:
- labels:
version: v1
name: cap-baseline
- labels:
version: v1
name: v1
在两个集群的相同命名空间下分别apply如上yaml。

被折叠的 条评论
为什么被折叠?



