Setting up Istio on Minikube for Running Bookinfo Demo Application

Jobinesh
2 min readJan 22, 2019

--

This post talks about quick steps for setting up Istio on Minikube for running Bookinfo demo application that comes with Istio installation. All the instructions listed in this post are based on macOS. If you use different OS, please refer to the link to official documentation given against each item.

  1. Install Docker: Please follow the instructions given in the official web site.
  2. Install Hypervisor, Minikube and Kubectl : You can find the detailed instructions here
  3. Start Minikube. Please note that you should change value for vm-driver based on hypervisor that you use, following one use ‘virtualbox’:
minikube start --memory=8192 --cpus=4 --kubernetes-version=v1.13.1 \
--extra-config=controller-manager.cluster-signing-cert-file="/var/lib/minikube/certs/ca.crt" \
--extra-config=controller-manager.cluster-signing-key-file="/var/lib/minikube/certs/ca.key" \
--vm-driver=virtualbox

4. Install Istio to an appropriate folder. If you need more details, please refer to official site.

curl -L https://git.io/getLatestIstio | sh -

5. Move to the folder where you have installed/extracted Istio in Step 4

cd istio-<version>
e.g: cd istio-1.0.5

6. You are in the same folder as in Step 5, where the Istio is installed. Add istioctl to the path

export PATH=$PWD/bin:$PATH

7. You are in same folder as in Step 5, where the Istio is installed. Install Custom Resource Definitions for Istio

kubectl apply -f install/kubernetes/helm/istio/templates/crds.yaml

8. You are in same folder as in Step 5, where the Istio is installed. Install the default mutual TLS authentication between sidecars for running the demo

kubectl apply -f install/kubernetes/istio-demo-auth.yaml

9. We are done with basic Istio level set ups, let us go ahead and deploy the demo app.You are in same folder as in Step 5, where the Istio is installed.

kubectl apply -f <(istioctl kube-inject -f samples/bookinfo/platform/kube/bookinfo.yaml)

10. Wait for sometime till all pods are ready

kubectl get pods

11. You are in same folder as in Step 5, where the Istio is installed.Define the ingress gateway for the application

kubectl apply -f samples/bookinfo/networking/bookinfo-gateway.yaml

12. Follow the below given instructions to set the INGRESS_HOST and INGRESS_PORT variables for accessing the gateway

export INGRESS_HOST=$(minikube ip)export INGRESS_PORT=$(kubectl -n istio-system get service istio-ingressgateway -o jsonpath='{.spec.ports[?(@.name=="http2")].nodePort}')export SECURE_INGRESS_PORT=$(kubectl -n istio-system get service istio-ingressgateway -o jsonpath='{.spec.ports[?(@.name=="https")].nodePort}')

13. Set GATEWAY_URL:

export GATEWAY_URL=$INGRESS_HOST:$INGRESS_PORT

14. Get the URL

printenv GATEWAY_URL

15. Cool, You all set by now. Step 14 outputs 192.168.99.104:31380 in my machine as host:port values. With this information, I can access the demo app using the following URL: http://192.168.99.104:31380/productpage

Congratulation ! You got your first Istio demo running. This demo application is composed of four separate microservices which demonstrate various Istio features. You can find more details here. Happy learning !

The views expressed on this post are my own and do not necessarily reflect the views of my employer.

--

--