Yamlcat<<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
Yamlcat<<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
Yamlcat<<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 许可协议。转载请注明出处!