virtual-environment
virtual-environment copied to clipboard
如何把ingressgateway和自动生成的virtualservice关联上
想让用户可以使用公网域名,从k8s集群外部访问,有没有ingressgateway配置的示例
搜索Istio Gateway配置就可以了,这种材料网络上比较容易找到
我部署了一个service-a服务,自动生成的virtualservice如下:
apiVersion: networking.istio.io/v1beta1
kind: VirtualService
metadata:
creationTimestamp: "2022-07-06T08:47:43Z"
generation: 1
name: service-a
namespace: demo
ownerReferences:
- apiVersion: env.alibaba.com/v1alpha2
blockOwnerDeletion: true
controller: true
kind: VirtualEnvironment
name: demo-virtualenv
uid: 3276e1dc-67b5-473d-b340-ce4eacd98a96
resourceVersion: "82058"
uid: 7abd2801-a420-4b2b-ba18-1ee63154f355
spec:
gateways:
- mesh
hosts:
- service-a
http:
- match:
- headers:
X-Virtual-Env:
exact: dev.proj1
port: 5000
route:
- destination:
host: service-a
port:
number: 5000
subset: dev-proj1
weight: 100
- match:
- port: 5000
route:
- destination:
host: service-a
port:
number: 5000
subset: dev
weight: 100
现在的疑问是,我想配置ingressgateway,公网域名为www.xxx.com,它无法和自动生成的virtualservice关联上。 现在能想到的是,照着这个virtualservice,再新建一个virtualservice,hosts部分改为www.xxx.com