Step-by-step introductory tutorial to microservices based on the Istio Bookinfo sample.
This tutorial demonstrates a single microservice as a web app, node.js, Docker. Then it proceeds to a whole application (Bookinfo), composed of multiple microservices, managed by Kubernetes with Istio. The learning modules show evolution of the application: development of a single microservice, creating a container, deploying the application to Kubernetes, adding Istio to the Kubernetes cluster, deploying new microservice versions, routing traffic to a new version, and finally, monitoring, logging, distributed tracing, fault injection and security policies. The Istio features are presented as part of the developing story. The focus is on why the presented Istio features are required and what can be achieved using Istio. While presenting Istio features, various microservices concepts are briefly described. In the summary module, links to further Istio documents are provided.
The tutorial supports running commands in multiple namespaces by multiple participants simultaneously. To set up multiple namespaces, create a namespace per participant, and for each participant set the value of the namespace in the context of a kubeconfig file.
To view the default namespace of a participant run:
echo $(kubectl config view -o jsonpath="{.contexts[?(@.name == \"$(kubectl config current-context)\")].context.namespace}")
The ideas and scenarios taken from the Production-Ready Microservices book of Susan Fowler and from the istio.io guides, tasks and blog.
-
Make yourself familiar with the microservices concept. The article of James Lewis and Martin Fowler is a good place to start.
-
Install node.js, docker and get access to a Kubernetes cluster. For example, you can try the IBM Cloud Container Service.
-
Download Istio and Bookinfo source:
make setup
-
Alias
istioctl
:alias istioctl=$(pwd)/istio-*/bin/istioctl
-
Go over
modules
, by their prefix number, issuingcd
to each modules's directory.