To play with Istio and demonstrate some of it's capabilities, you will deploy the example BookInfo application, which is included the Istio package.
The end-to-end architecture of the application is shown in the figure.
Figure: BookInfo deployed off the mesh
As shown in the figure below, proxies are sidecarred to each of the application containers.
Figure: BookInfo deployed on the mesh
1kubectl 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 Previous chapter, you have deployed the sidecar injector.
1kubectl -n istio-system get configmaps istio-sidecar-injector
Output:
1NAME DATA AGE2istio-sidecar-injector 2 9h
NamespaceSelector decides whether to run the webhook on an object based on whether the namespace for that object matches the selector.
1kubectl get namespace -L istio-injection
Output:
1NAME STATUS AGE ISTIO-INJECTION2default Active 1h enabled3istio-system Active 1h disabled4kube-public Active 1h5kube-system Active 1h
Using Meshery, navigate to the Istio management page.
default
in the Namespace
field.Sample Application
card and select BookInfo Application
from the list.This will do 3 things:
default
namespace for sidecar injection.default
namespace.default
namespace.1watch kubectl get deployment
productpage
, and view it's container configuration:1kubectl get po23kubectl describe pod productpage-v1-.....
1kubectl describe svc productpage
Next, you will expose the BookInfo application to be accessed external from the cluster.
Label the default namespace with istio-injection=enabled
1kubectl label namespace default istio-injection=enabled
1kubectl get namespace -L istio-injection
Output:
1NAME STATUS AGE ISTIO-INJECTION2default Active 1h enabled3istio-system Active 1h disabled4kube-public Active 1h5kube-system Active 1h
Applying this yaml file included in the Istio package you collected in Getting Started will deploy the BookInfo app in you cluster.
1kubectl apply -f samples/bookinfo/platform/kube/bookinfo.yaml
1kubectl apply -f samples/bookinfo/networking/bookinfo-gateway.yaml
Use this only when Automatic Sidecar injection doesn't work
To do a manual sidecar injection we will be using istioctl
command:
1curl https://raw.githubusercontent.com/istio/istio/master/samples/bookinfo/platform/kube/bookinfo.yaml | istioctl kube-inject -f - > newBookInfo.yaml
Observing the new yaml file reveals that additional container Istio Proxy has been added to the Pods with necessary configurations:
1image: docker.io/istio/proxyv2:1.3.02 imagePullPolicy: IfNotPresent3 name: istio-proxy
We need to now deploy the new yaml using kubectl
1kubectl apply -f newBookInfo.yaml
To do both in a single command:
1kubectl apply -f <(curl https://raw.githubusercontent.com/istio/istio/master/samples/bookinfo/platform/kube/bookinfo.yaml | istioctl kube-inject -f -)
Now continue to Verify Bookinfo deployment.