mirror of https://github.com/istio/istio.io.git
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:
parent
ac1cbc7730
commit
4203f1b102
|
@ -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,
|
||||
|
|
|
@ -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,
|
||||
|
|
Loading…
Reference in New Issue