编辑
2024-01-08
Istio
00
请注意,本文编写于 380 天前,最后修改于 354 天前,其中某些信息可能已经过时。

目录

VirtualService
DestinationRule
Yaml
cat<<EOF | kubectl apply -f - apiVersion: networking.istio.io/v1alpha3 kind: Gateway metadata: name: gateway-gw namespace: test spec: servers: - port: number: 80 name: http protocol: HTTP hosts: - 'gateway-test.caogx.cn' selector: app: istio-ingressgateway istio: ingressgateway EOF

VirtualService

Yaml
cat<<EOF | kubectl apply -f - apiVersion: networking.istio.io/v1alpha3 kind: VirtualService metadata: name: gateway-vs namespace: test spec: hosts: - "gateway-test.caogx.cn" gateways: - gateway-gw http: - match: - uri: prefix: / route: - destination: host: gateway.test.svc.cluster.local subset: v2 port: number: 8762 weight: 50 - destination: host: gateway.test.svc.cluster.local subset: v1 port: number: 8762 weight: 50 EOF

DestinationRule

Yaml
cat<<EOF | kubectl apply -f - apiVersion: networking.istio.io/v1alpha3 kind: DestinationRule metadata: name: gateway-dr namespace: test spec: host: gateway.test.svc.cluster.local subsets: - name: v2 labels: version: v2 - name: v1 labels: version: v1 trafficPolicy: loadBalancer: simple: ROUND_ROBIN EOF

本文作者:曹操

本文链接:

版权声明:本博客所有文章除特别声明外,均采用 BY-NC-SA 许可协议。转载请注明出处!