Home Explore Blog CI



kubernetes

3rd chunk of `content/en/blog/_posts/2017-05-00-Managing-Microservices-With-Istio-Service-Mesh.md`
4c6fac3f155002ba008784ef3922f740ed1c1c9befc746d1000000010000082c
![BookInfo-v1 (3).png](https://lh4.googleusercontent.com/yD_ktHrTzgybi2DXdRWlrGD78rQgWvcGgDoWj0Pv5QtREPsmoz5pNDd2JI_MeiXx6kIS4QKy_Ved2hXsa68AqGpLftcWlPmYtew5DJqi6fNZrBHfVymjhDCGWgoHEIuzWaf9_doP)

Deploying it with Kubernetes is straightforward, no different than deploying any other services. Service and Deployment resources for the **productpage** microservice looks like this:



 ```
apiVersion: v1

kind: Service

metadata:

 name: productpage

 labels:

   app: productpage

spec:

 type: NodePort

 ports:

 - port: 9080

   name: http

 selector:

   app: productpage

---

apiVersion: extensions/v1beta1

kind: Deployment

metadata:

 name: productpage-v1

spec:

 replicas: 1

 template:

   metadata:

     labels:

       app: productpage

       track: stable

   spec:

     containers:

     - name: productpage

       image: istio/examples-bookinfo-productpage-v1

       imagePullPolicy: IfNotPresent

       ports:

       - containerPort: 9080
  ```




The other two services that we will need to deploy if we want to run the app are **details** and **reviews-v1**. We don’t need to deploy the **ratings** service at this time because v1 of the reviews service doesn’t use it. The remaining services follow essentially the same pattern as **productpage**. The yaml files for all services can be found [here](https://raw.githubusercontent.com/istio/istio/master/samples/bookinfo/platform/kube/bookinfo.yaml).



To run the services as an ordinary Kubernetes app:  

 ```
kubectl apply -f bookinfo-v1.yaml
  ```



To access the application from outside the cluster we’ll need the NodePort address of the **productpage** service:



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



We can now point the browser to http://$BOOKINFO\_URL/productpage, and see:



 ![](https://lh3.googleusercontent.com/AP3bEJR9uqsXufk5kZqD4DaRUs9ynuybfM8KBJlv_sF0g6A8LRO606jr_Z8xL71TrKWt_OfTXDJCcISZGy6ucj4KVZVFPFT8NCOOf6PpEZ0XVKlw-fgRP0iJvaBKuZaH-dySdJZ-)

Title: Deploying the Bookinfo Application v1 on Kubernetes
Summary
Deploying the Bookinfo v1 application on Kubernetes involves creating Service and Deployment resources. The example shows the YAML configuration for the 'productpage' microservice. The 'details' and 'reviews-v1' services also need to be deployed, while 'ratings' is not required for v1. The YAML files for all services are available in the provided link. The application can be deployed using 'kubectl apply -f bookinfo-v1.yaml', and accessed externally via the NodePort address of the 'productpage' service.