Home Explore Blog CI



kubernetes

1st chunk of `content/en/blog/_posts/2017-10-00-Request-Routing-And-Policy-Management.md`
69fe5cc64eb6f8fced736eaa29a30e1c2d90338a6f0f32480000000100000aa1
---
title: " Request Routing and Policy Management with the Istio Service Mesh "
date: 2017-10-10
slug: request-routing-and-policy-management
url: /blog/2017/10/Request-Routing-And-Policy-Management
author: >
  Frank Budinsky (IBM),
  Andra Cismaru (Google),
  Israel Shalom (Google)
---
_**Editor's note:** Today’s post is the second post in a three-part series on Istio._

In a [previous article](https://kubernetes.io/blog/2017/05/managing-microservices-with-istio-service-mesh), we looked at a [simple application (Bookinfo)](https://istio.io/docs/guides/bookinfo.html) that is composed of four separate microservices. The article showed how to deploy an application with Kubernetes and an Istio-enabled cluster without changing any application code. The article also outlined how to view Istio provided L7 metrics on the running services.  

This article follows up by taking a deeper look at Istio using Bookinfo. Specifically, we’ll look at two more features of Istio: request routing and policy management.  


## Running the Bookinfo Application
As before, we run the v1 version of the Bookinfo application. After [installing Istio](https://istio.io/docs/setup/kubernetes/quick-start.html) in our cluster, we start the app defined in [bookinfo-v1.yaml](https://raw.githubusercontent.com/istio/istio/master/samples/kubernetes-blog/bookinfo-v1.yaml) using the following command:  



 ```  
kubectl apply -f \<(istioctl kube-inject -f bookinfo-v1.yaml)
  ```

We created an Ingress resource for the app:




 ```  
cat \<\<EOF | kubectl create -f -

apiVersion: extensions/v1beta1

kind: Ingress

metadata:

 name: bookinfo

 annotations:

     kubernetes.io/ingress.class: "istio"

spec:

 rules:

 - http:

         paths:

         - path: /productpage

             backend:

                 serviceName: productpage

                 servicePort: 9080

         - path: /login

             backend:

                 serviceName: productpage

                 servicePort: 9080

         - path: /logout

             backend:

                 serviceName: productpage

                 servicePort: 9080

EOF
  ```

Then we retrieved the NodePort address of the Istio Ingress controller:



 ```  
export BOOKINFO\_URL=$(kubectl get po -n istio-system -l istio=ingress -o jsonpath={.items[0].status.hostIP}):$(kubectl get svc -n istio-system istio-ingress -o jsonpath={.spec.ports[0].nodePort})
  ```

Finally, we pointed our browser to [http://$BOOKINFO\_URL/productpage](about:blank), to see the running v1 application:



 ![](https://lh3.googleusercontent.com/kGRJnhkf30FBOY2pyZzID90f_zxlyMUv43hEvfq70bcmYhKrGv2em2qph21k-ahlwfBthV3XQSf6CuUQXMlvgSlOUJr4W1ksDVXIvChEd6a5Y51lwepHmyQx2ksJgUpyTiEbZN11)

Title: Running the Bookinfo Application with Istio
Summary
This article delves into Istio's features using the Bookinfo application. It outlines the steps to run the v1 version of the Bookinfo application by installing Istio, deploying the app, creating an Ingress resource, retrieving the NodePort address of the Istio Ingress controller, and accessing the running application through a browser.