Enabling Istio for new applications

To show how to enable sidecar injection automatically, we will delete the existing istio-lab namespace, and we will redeploy bookinfo so that Istio is automatically enabled with the proxy for the new application. Follow these steps:

  1. First, delete the istio-lab namespace:
$ kubectl delete namespace istio-lab
If you get namespace deletion in a perpetual terminating state, use the script to get rid of the namespace: https://github.com/jefferyb/useful-scripts/blob/master/openshift/force-delete-openshift-project.
  1. Now, create the istio-lab namespace again and label it using istio-injection=enabled:
$ kubectl create namespace istio-lab
namespace/istio-lab created

$ kubectl label namespace istio-lab istio-injection=enabled
namespace/istio-lab labeled

By labeling an istio-injection=enabled namespace, the Istio sidecar gets injected automatically when the application is deployed using kubectl apply or the helm command.

  1. Deploy the application again:
$ kubectl -n istio-lab apply -f ~/servicemesh/bookinfo.yaml
  1. Run kubectl -n istio-lab get pods and wait for them to be ready. You will notice that each pod has two containers, and one of them is the sidecar.
  2. Run istioctl proxy-status, which provides the sync status from pilot to each proxy in the mesh. 

Now that Istio has been enabled, we are ready to learn about its capabilities using examples from https://istio.io. In the next section, we will set up horizontal pod scaling for Istio services.

https://istio.io/ is the official open source site. It has in-depth examples to explain Istio. This book has leveraged many examples from the official site to explain its core capabilities to beginners and help them to grasp the fundamentals of Istio.
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.17.174.239