This guide explains how to deploy the Bookinfo application on Kubernetes and enable Istio sidecar injection for traffic management.
In this guide, we will deploy the Bookinfo application on a Kubernetes cluster, enable Istio sidecar injection, and set up our service mesh for traffic management. The Bookinfo application’s manifests can be found under the samples folder that comes with Istio.
When executing this command, Kubernetes creates service, service account, and deployment objects corresponding to each component of the Bookinfo application. Notably, multiple versions of the Reviews service are deployed.After applying the configuration, verify that all pods are running:
At this stage, every pod runs a single container because Istio sidecar injection has not been enabled yet. Consequently, the Envoy proxies are not present alongside your application containers.
Before re-deploying the pods, you should verify potential issues with sidecar injection using the Istioctl tool:
Copy
Ask AI
istioctl analyze
You might see an informational message mentioning that the default namespace is not enabled for Istio injection. This occurs because enabling sidecar injection requires explicitly labeling the namespace.Label the default namespace to enable Istio injection:
After labeling the namespace, the pods must be recreated so that the Envoy sidecars are injected. A simple method is to delete the current deployments and apply the YAML configuration again. This ensures that only the pods missing the sidecars are recreated.Reapply the manifests using:
You should now notice that each pod has an additional container, indicating that the Istio sidecar has been successfully injected. If you see some pods marked as terminating, they will disappear after a short period.
You can always verify successful sidecar injection by ensuring that each pod reports two containers as ready.
Finally, run Istioctl analyze one more time to ensure that there are no issues:
Copy
Ask AI
istioctl analyze
The output should confirm that the default namespace was analyzed without reporting any issues with Istio objects, for example:
Copy
Ask AI
✓ No validation issues found when analyzing namespace: default.
An example of the pod status after injection might look like this:
If you observe pods stuck in a terminating state for an extended period, wait a short while and perform the status check again.
Congratulations! Your service mesh is now correctly configured with Istio sidecar injection, and you are ready to begin building and testing your service mesh interactions.For more information on Istio and service meshes in Kubernetes, explore the following resources: