Use route rules in istio file directly. (#1581)

We have created the files in istio already at
https://github.com/istio/istio/pull/6102 , so there is no need
to create the file again.
This commit is contained in:
Guang Ya Liu 2018-06-26 02:15:27 +08:00 committed by istio-bot
parent ac1cbc7730
commit 4203f1b102
2 changed files with 2 additions and 52 deletions

View File

@ -25,35 +25,10 @@ service.
$ istioctl create -f @samples/bookinfo/routing/route-rule-all-v1.yaml@
```
Save the following YAML snippet as `route-rule-reviews-jason-v2-v3.yaml`:
```yaml
apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
name: reviews
spec:
hosts:
- reviews
http:
- match:
- headers:
cookie:
regex: "^(.*?;)?(user=jason)(;.*)?$"
route:
- destination:
host: reviews
subset: v2
- route:
- destination:
host: reviews
subset: v3
```
and then run the following command:
```command
$ istioctl replace -f route-rule-reviews-jason-v2-v3.yaml
$ istioctl replace -f @samples/bookinfo/routing/route-rule-reviews-jason-v2-v3.yaml.yaml@
```
> If you have a conflicting rule that you set in previous tasks,

View File

@ -23,35 +23,10 @@ This task shows how to control access to a service using the Kubernetes labels.
$ istioctl create -f @samples/bookinfo/routing/route-rule-all-v1.yaml@
```
Save the following YAML snippet as `route-rule-reviews-jason-v2-v3.yaml`:
```yaml
apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
name: reviews
spec:
hosts:
- reviews
http:
- match:
- headers:
cookie:
regex: "^(.*?;)?(user=jason)(;.*)?$"
route:
- destination:
host: reviews
subset: v2
- route:
- destination:
host: reviews
subset: v3
```
and then run the following command:
```command
$ istioctl replace -f route-rule-reviews-jason-v2-v3.yaml
$ istioctl replace -f @samples/bookinfo/routing/route-rule-reviews-jason-v2-v3.yaml.yaml@
```
> If you have conflicting rules that you set in previous tasks,