Lab 2 - Deploying Guestbook Application
Last updated
Last updated
The Guestbook app is a sample app for users to leave comments. It consists of a web front end, Redis master for storage, and a replicated set of Redis slaves. We will also integrate the app with Watson Tone Analyzer which detects the sentiment in users' comments and replies with emoticons.
Clone the Guestbook app into the workshop
directory.
Navigate into the app directory.
In Kubernetes, a sidecar is a utility container in the pod, and its purpose is to support the main container. For Istio to work, Envoy proxies must be deployed as sidecars to each pod of the deployment. There are two ways of injecting the Istio sidecar into a pod: manually using the istioctl CLI tool or automatically using the Istio sidecar injector. In this exercise, we will use the automatic sidecar injection provided by Istio.
Annotate the default namespace to enable automatic sidecar injection:
Validate the namespace is annotated for automatic sidecar injection:
Sample output:
The Redis database is a service that you can use to persist the data of your app. The Redis database comes with a master and slave modules.
Create the Redis controllers and services for both the master and the slave.
Verify that the Redis controllers for the master and the slave are created.
Output:
Verify that the Redis services for the master and the slave are created.
Output:
Verify that the Redis pods for the master and the slave are up and running.
Output:
Inject the Istio Envoy sidecar into the guestbook pods, and deploy the Guestbook app on to the Kubernetes cluster. Deploy both the v1 and v2 versions of the app:
These commands deploy the Guestbook app on to the Kubernetes cluster. Since we enabled automation sidecar injection, these pods will be also include an Envoy sidecar as they are started in the cluster. Here we have two versions of deployments, a new version (v2
) in the current directory, and a previous version (v1
) in a sibling directory. They will be used in future sections to showcase the Istio traffic routing capabilities.
Create the guestbook service.
Verify that the service was created.
Output:
Verify that the pods are up and running.
Sample output:
Note that each guestbook pod has 2 containers in it. One is the guestbook container, and the other is the Envoy proxy sidecar.
Great! Your guestbook app is up and running. In the next exercise you will expose the Istio service mesh with the Ingress Gateway