mirror of https://github.com/istio/istio.io.git
optimize format for access control doc. (#1501)
This commit is contained in:
parent
be77aabb68
commit
9a95ec99e1
|
@ -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:
|
||||
|
|
Loading…
Reference in New Issue