Skip to content

Latest commit

 

History

History
94 lines (64 loc) · 3.94 KB

README.md

File metadata and controls

94 lines (64 loc) · 3.94 KB

Lab 2 - Deploy example 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.

What is the BookInfo Application?

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 here.

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.

Sidecars proxy can be either manually or automatically injected into your pods.

Automatic sidecar injection requires that your Kubernetes api-server supports admissionregistration.k8s.io/v1beta1 or admissionregistration.k8s.io/v1beta2 APIs. Verify whether your Kubernetes deployment supports these APIs by executing:

kubectl api-versions | grep admissionregistration

If your environment does NOT supports either of these two APIs, then you may use manual sidecar injection to deploy the sample app.

As part of Istio deployment in Lab 2, we have deployed the sidecar injector.

Bonus! Your lab contais a custom version of the Bookinfo app that integrates with your Twitter account to send out a special message (and gift). For those without a Twitter account or who do not want to send a tweet, you can deploy the sample app without Twitter integration.

Deploying Sample App with Automatic sidecar injection

Istio, deployed as part of this workshop, will also deploy the sidecar injector. Let us now verify sidecar injector deployment & label namespace for automatic sidecar injection.

kubectl -n istio-system get deployment -l istio=sidecar-injector

Output:

NAME                     DESIRED   CURRENT   UP-TO-DATE   AVAILABLE   AGE
istio-sidecar-injector   1         1         1            1           1d

NamespaceSelector decides whether to run the webhook on an object based on whether the namespace for that object matches the selector.

Label the default namespace with istio-injection=enabled

kubectl label namespace default istio-injection=enabled
kubectl get namespace -L istio-injection

Output:

NAME           STATUS    AGE       ISTIO-INJECTION
default        Active    1h        enabled
istio-system   Active    1h        
kube-public    Active    1h        
kube-system    Active    1h

Now that we have the sidecar injector with mutating webhook in place and the namespace labelled for automatic sidecar injection, we can proceed to deploy the sample app:

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

Verify Bookinfo deployment

  1. Verify that previous deployments are all in a state of AVAILABLE before continuing. Do not proceed until they are up and running.

    watch kubectl get deployment
  2. Inspect the details of the pods

    Let us look at the details of the pods:

    watch kubectl get po

    Let us look at the details of the services:

    watch kubectl get svc

    Now let us pick a service, for instance productpage service, and view it's sidecar configuration:

    kubectl get po
    
    kubectl describe pod productpage-v1-.....