当我使用这个VS时,我可以通过1.2.3.4访问我的http服务,但是当我将http更改为tcp时,我无法通过1.2.3.4访问我的http服务,这是怎么回事?
apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
name: httpbin-vir
spec:
hosts:
- httpbin.default.svc.cluster.local
- 1.2.3.4
http:
- match:
- port: 8000
sourceLabels:
version: base
route:
- destination:
host: httpbin.default.svc.cluster.local
subset: base
- match:
- port: 8000
sourceLabels:
version: feature
route:
- destination:
host: httpbin.default.svc.cluster.local
subset: feature
apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
name: httpbin-vir
spec:
hosts:
- httpbin.default.svc.cluster.local
- 1.2.3.4
tcp:
- match:
- port: 8000
sourceLabels:
version: base
route:
- destination:
host: httpbin.default.svc.cluster.local
subset: base
- match:
- port: 8000
sourceLabels:
version: feature
route:
- destination:
host: httpbin.default.svc.cluster.local
subset: feature
如果这个方法不行,我想知道如何在TCP路由下通过1.2.3.4访问我的服务