Skip to content

Update Mastering Service Mesh Learning Path #6

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 21, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -12,30 +12,22 @@ title: "Deploy a sample application"

To play with Istio and demonstrate some of it's capabilities, you will deploy the example BookInfo application, which is included the Istio package.

<h2 class="chapter-sub-heading">What is the Bookinfo Application </h2>
<br />
### **What is the Bookinfo Application**
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Headings should not have separate bold styling.


This application is a polyglot composition of microservices are written in different
languages and sample BookInfo application displays information about a book, similar to a
single catalog entry of an online book store. Displayed on the page is a description of
the book, book details (ISBN, number of pages, and so on), and a few book reviews.

The end-to-end architecture of the application is shown in the figure.

<br />

_Figure: BookInfo deployed off the mesh_

<br />
It’s worth noting that these services have no dependencies on Istio, but make an interesting
service mesh example, particularly because of the multitude of services, languages and versions
for the reviews service.

As shown in the figure below, proxies are sidecarred to each of the application containers.

<br />
_Figure: BookInfo deployed on the mesh_

<br />
Sidecars proxy can be either manually or automatically injected into the pods. Automatic sidecar
injection requires that your Kubernetes api-server supports `admissionregistration.k8s.io/v1`
or `admissionregistration.k8s.io/v1beta1` or `admissionregistration.k8s.io/v1beta2` APIs. Verify
Expand All @@ -49,12 +41,10 @@ If your environment **does NOT** supports either of these two APIs, then you may

As part of Istio deployment in [Previous chapter](./getting-started), you have deployed the sidecar injector.

<br />
<h2 class="chapter-sub-heading">
<a name="auto"></a> Deploying Sample App with Automatic sidecar injection
</h2>

<br />
Istio, deployed as part of this workshop, will also deploy the sidecar injector. Let us now
verify sidecar injector deployment.

Expand Down Expand Up @@ -96,9 +86,7 @@ This will do 3 things:
1. Deploys all the BookInfo services in the `default` namespace.
1. Deploys the virtual service and gateway needed to expose the BookInfo's productpage application in the `default` namespace.

<h3 class="chapter-sub-heading">
<a name="verify"></a> Verify Bookinfo deployment{" "}
</h3>
#### **Verify Bookinfo deployment**

1. Verify that the deployments are all in a state of AVAILABLE before continuing.

Expand All @@ -122,13 +110,9 @@ kubectl describe svc productpage

Next, you will expose the BookInfo application to be accessed external from the cluster.

<br />
<h3>Alternative: Manual installation </h3>
#### **Alternative: Manual installation**
Follow this if the above steps did not work for you
<br />
<br />

<h4 class="chapter-alt-heading"> Label namespace for injection</h4>
##### **Label namespace for injection**

Label the default namespace with istio-injection=enabled

Expand All @@ -150,23 +134,21 @@ kube-public Active 1h
kube-system Active 1h
```

<h4 class="chapter-alt-heading"> Deploy BookInfo</h4>
<br />
#### **Deploy BookInfo**

Applying this yaml file included in the Istio package you collected in [Getting Started](./getting-started) will deploy the BookInfo app in you cluster.

```sh
kubectl apply -f samples/bookinfo/platform/kube/bookinfo.yaml
```

<h4 class="chapter-alt-heading">Deploy Gateway and Virtual Service for BookInfo app</h4>
#### **Deploy Gateway and Virtual Service for BookInfo app**

```sh
kubectl apply -f samples/bookinfo/networking/bookinfo-gateway.yaml
```

<hr />
<br />

<h3>
<a name="manual-sidecar-inj" />
Expand All @@ -183,7 +165,7 @@ curl https://raw.githubusercontent.com/istio/istio/master/samples/bookinfo/platf

Observing the new yaml file reveals that additional container Istio Proxy has been added to the Pods with necessary configurations:

```
```yaml
image: docker.io/istio/proxyv2:1.3.0
imagePullPolicy: IfNotPresent
name: istio-proxy
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,9 @@ id: "expose-services"
{{< chapterstyle >}}
The components deployed on the service mesh by default are not exposed outside the cluster. An Ingress Gateway is deployed as a Kubernetes service of type LoadBalancer (or NodePort). To make Bookinfo accessible external to the cluster, you have to create an `Istio Gateway` for the Bookinfo application and also define an `Istio VirtualService` with the routes we need.

<br />
<br />
### **Inspecting the Istio Ingress Gateway**

<h2 class="chapter-sub-heading"> Inspecting the Istio Ingress Gateway</h2>

<br />
The ingress gateway gets exposed as a normal Kubernetes service of type LoadBalancer (or NodePort):

```sh
Expand Down Expand Up @@ -61,10 +58,9 @@ Now let us find the ingress pod and output the log:
kubectl logs istio-ingressgateway-... -n istio-system
```

<h2 class="chapter-sub-heading">View Istio Ingress Gateway for Bookinfo</h2>
<br />
### **View Istio Ingress Gateway for Bookinfo**

<h3 class="chapter-sub-heading"> View the Gateway and VirtualServices</h3>
#### **View the Gateway and VirtualServices**

Check the created `Istio Gateway` and `Istio VirtualService` to see the changes deployed:

Expand All @@ -76,9 +72,8 @@ kubectl get virtualservices
kubectl get virtualservices -o yaml
```

<h3 class="chapter-sub-heading">
Find the external port of the Istio Ingress Gateway by running:
</h3>
#### **Find the external port of the Istio Ingress Gateway by running:**


```sh
kubectl get service istio-ingressgateway -n istio-system -o wide
Expand All @@ -90,7 +85,7 @@ To just get the first port of istio-ingressgateway service, we can run this:
kubectl get service istio-ingressgateway -n istio-system --template='{{(index .spec.ports 1).nodePort}}'
```

<h3 class="chapter-sub-heading"> Create a DNS entry:</h3>
#### **Create a DNS entry:**

Modify your local `/etc/hosts` file to add an entry for your sample application.

Expand All @@ -106,7 +101,7 @@ echo "http://$(kubectl get nodes --selector=kubernetes.io/role!=master -o jsonpa

Docker Desktop users please use `http://localhost/productpage` to access product page in your browser.

<h2 class="chapter-sub-heading"> Apply default destination rules</h2>
### **Apply default destination rules**

Before we start playing with Istio's traffic management capabilities we need to define the available versions of the deployed services. They are called subsets, in destination rules.

Expand Down Expand Up @@ -187,16 +182,16 @@ kubectl get destinationrules
kubectl get destinationrules -o yaml
```

<h2 class="chapter-sub-heading"> Browse to BookInfo</h2>
### **Browse to BookInfo**

Browse to the website of the Bookinfo. To view the product page, you will have to append
`/productpage` to the url.

<h3 class="chapter-sub-heading"> Reload Page</h3>
#### **Reload Page**

Now, reload the page multiple times and notice how it round robins between v1, v2 and v3 of the reviews service.

<h2 class="chapter-sub-heading">Inspect the Istio proxy of the productpage pod</h2>
###Inspect the Istio proxy of the productpage pod

To better understand the istio proxy, let's inspect the details. Let us `exec` into the productpage pod to find the proxy details. To do so we need to first find the full pod name and then `exec` into the istio-proxy container:

Expand All @@ -221,24 +216,21 @@ As a last step, lets exit the container:
exit
```

<br />
<h3>Alternative: Manual installation</h3>
### **Alternative: Manual installation**

Follow this if the above steps did not work for you

<br />
<br />

<h4 class="chapter-alt-heading"> Default destination rules</h4>
##### **Default destination rules**

Run the following command to create default destination rules for the Bookinfo services:

```sh
kubectl apply -f samples/bookinfo/networking/destination-rule-all-mtls.yaml
```

<h4 class="chapter-alt-heading">
Configure the Bookinfo route with the Istio Ingress gateway
</h4>
##### **Configure the Bookinfo route with the Istio Ingress gateway**


We can create a virtualservice & gateway for bookinfo app in the ingress gateway by running the following:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ title: "Getting Started with Istio"

{{< chapterstyle >}}

<h2 class="chapter-sub-heading">Setup Istio </h2>
### **Setup Istio**

Now that we have a Kubernetes cluster and Meshery, we are ready to download and deploy Istio resources.

<h2 class="chapter-sub-heading">Steps</h2>
### **Steps**

1. [Install Istio](#1)
1. [Verify install](#2)
Expand All @@ -25,9 +25,8 @@ Optional (manual install of Istio):
1. [Setup `istioctl`](#1.2)
1. [Install istio](#1.3)

<h3 class="chapter-sub-heading">
<a name="1">Install Istio</a>
</h3>
#### **Install Istio**


Using Meshery, select `Istio` from the `Management` menu.

Expand All @@ -36,15 +35,10 @@ In the Istio management page:
1. Type `istio-system` into the namespace field.
1. Click the (+) icon on the `Install` card and select `Latest Istio` to install the latest version of Istio.

<h3>Alternative:Manual installation</h3>
#### **Alternative:Manual installation**
Perform the below steps if the above steps doesn't work for you.

<br />
<br />

<h4 class="chapter-alt-heading">
<a name="1.1">Download Istio</a>
</h4>
#### **Download Istio**

You will download and deploy the latest Istio resources on your Kubernetes cluster.

Expand All @@ -55,10 +49,7 @@ On your local machine, execute:
```sh
curl -L https://git.io/getLatestIstio | ISTIO_VERSION=1.7.3 sh -
```

<h4 class="chapter-alt-heading">
<a name="1.2">Setting up istioctl</a>
</h4>
#### **Setting up istioctl**

On a \*nix system, you can setup `istioctl` by doing the following:

Expand All @@ -85,9 +76,7 @@ Check if the cluster is ready for installation:
istioctl verify-install
```

<h4 class="chapter-alt-heading">
<a name="1.3">Install Istio</a>
</h4>
##### **Install Istio**

To install Istio with a `demo` profile, execute the below command.

Expand All @@ -101,16 +90,14 @@ Alternatively, with Envoy logging enabled:
istioctl install --set profile=demo --set meshConfig.accessLogFile=/dev/stdout
```

<h3 class="chapter-sub-heading">
<a name="2">Verify install</a>
</h3>
#### **Verify install**

In the Istio management page:

1. Click the (+) icon on the `Validate Service Mesh Configuration` card.
1. Select `Verify Installation` to verify the installation of Istio.

<h4 class="chapter-alt-heading">Alternatively:</h4>
#### **Alternatively:**

Istio is deployed in a separate Kubernetes namespace `istio-system`. To check if Istio is deployed, and also, to see all the pieces that are deployed, execute the following:

Expand Down
Loading