istio.io/istio@v0.0.0-20240520182934-d79c90f27776/pkg/config/analysis/analyzers/testdata/virtualservice_conflictingmeshgatewayhosts.yaml (about) 1 apiVersion: networking.istio.io/v1alpha3 2 kind: VirtualService 3 metadata: 4 name: productpage 5 namespace: foo 6 spec: 7 hosts: 8 - productpage # should generate an error as this conflicts with VirtualService foo/bogus 9 http: 10 - route: 11 - destination: 12 host: productpage 13 --- 14 apiVersion: networking.istio.io/v1alpha3 15 kind: VirtualService 16 metadata: 17 name: bogus-productpage 18 namespace: foo 19 spec: 20 hosts: 21 - productpage # should generate an error as this conflicts with VirtualService foo/productpage 22 http: 23 - route: 24 - destination: 25 host: reviews 26 --- 27 apiVersion: networking.istio.io/v1alpha3 28 kind: VirtualService 29 metadata: 30 name: reviews 31 namespace: foo 32 spec: 33 hosts: 34 - reviews # shouldn't generate an error as there's no conflicting VirtualService 35 http: 36 - route: 37 - destination: 38 host: reviews 39 --- 40 apiVersion: networking.istio.io/v1alpha3 41 kind: VirtualService 42 metadata: 43 name: reviews 44 namespace: bar 45 spec: 46 hosts: 47 - reviews.foo.svc.cluster.local # shouldn't generate an error as the gateway is different even though host is the same 48 gateways: 49 - istio-ingressgateway 50 http: 51 - route: 52 - destination: 53 host: reviews 54 --- 55 apiVersion: networking.istio.io/v1alpha3 56 kind: VirtualService 57 metadata: 58 name: ratings 59 namespace: foo 60 spec: 61 hosts: 62 - ratings # should generate an error as this conflicts with VirtualService bar/ratings 63 gateways: 64 - mesh 65 http: 66 - route: 67 - destination: 68 host: ratings 69 --- 70 apiVersion: networking.istio.io/v1alpha3 71 kind: VirtualService 72 metadata: 73 name: ratings 74 namespace: bar 75 spec: 76 hosts: 77 - ratings.foo.svc.cluster.local # should generate an error as mesh gateway is specified and hosts conflict with VirtualService foo/ratings 78 - google.com 79 gateways: 80 - istio-ingressgateway 81 - mesh 82 http: 83 - route: 84 - destination: 85 host: ratings 86 --- 87 apiVersion: networking.istio.io/v1alpha3 88 kind: VirtualService 89 metadata: 90 name: ratings 91 namespace: team1 92 spec: 93 hosts: 94 - ratings # shouldn't generate an error as this doesn't conflict with VirtualService ratings.team2 due to exportTo setting 95 gateways: 96 - mesh 97 exportTo: 98 - "." 99 http: 100 - route: 101 - destination: 102 host: ratings 103 --- 104 apiVersion: networking.istio.io/v1alpha3 105 kind: VirtualService 106 metadata: 107 name: ratings 108 namespace: team2 109 spec: 110 hosts: 111 - ratings.team1.svc.cluster.local # shouldn't generate an error as this VirtualService doesn't conflict with VirtualService ratings.team1 due to exportTo setting 112 - google.com # conflict with bar/ratings host `google.com` which export to all namespaces 113 exportTo: 114 - "." 115 gateways: 116 - istio-ingressgateway 117 - mesh 118 http: 119 - route: 120 - destination: 121 host: ratings 122 --- 123 apiVersion: networking.istio.io/v1alpha3 124 kind: VirtualService 125 metadata: 126 name: ratings 127 namespace: team3 128 spec: 129 hosts: 130 - ratings # should generate an error as this conflicts with VirtualService ratings.team4 131 gateways: 132 - mesh 133 exportTo: 134 - "*" 135 http: 136 - route: 137 - destination: 138 host: ratings 139 --- 140 apiVersion: networking.istio.io/v1alpha3 141 kind: VirtualService 142 metadata: 143 name: ratings 144 namespace: team4 145 spec: 146 hosts: 147 - ratings.team3.svc.cluster.local # should generate an error as this conflicts with VirtualService ratings.team3 148 gateways: 149 - istio-ingressgateway 150 - mesh 151 http: 152 - route: 153 - destination: 154 host: ratings