optimize format for access control doc. (#1501)

This commit is contained in:
Morven Cao 2018-06-15 21:24:39 +08:00 committed by Martin Taillefer
parent be77aabb68
commit 9a95ec99e1
1 changed files with 22 additions and 22 deletions

View File

@ -15,8 +15,8 @@ This task shows how to control access to a service using the Kubernetes labels.
* Deploy the [Bookinfo](/docs/guides/bookinfo/) sample application.
* Initialize the application version routing to direct `reviews` service requests from
test user "jason" to version v2 and requests from any other user to v3.
* Initialize the application version routing to direct `reviews` service requests from
test user "jason" to version v2 and requests from any other user to v3.
```command
$ istioctl create -f @samples/bookinfo/routing/route-rule-all-v1.yaml@
@ -25,26 +25,26 @@ This task shows how to control access to a service using the Kubernetes labels.
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
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: