My experience on setting up Istio locally

Recently Istio(means ‘sail’ in Greek) was announced, an open source platform that can manage, connect and secure your microservice. It packages tons of features like:

  • Load balancing
  • Metrics collection
  • Logs collection
  • Tracing
  • Request routing
  • Discovery and load balancing
  • Fault injection
  • Rate limiting
  • Auth
  • and much more…

Note: On official documentation the way to install minikube for mac users is by executing:

curl -Lo minikube https://storage.googleapis.com/minikube/releases/v0.19.0/minikube-darwin-amd64 && chmod +x minikube && sudo mv minikube /usr/local/bin/

however if you are using home-brew + cask then you can just use:

brew cask install minikube

I wanted to give it a try so headed straight and went through istio-docs. In no time everything was up and running locally. Then thought to deploy BookInfo, a sample app that ships with Istio and while exporting GATEWAY_URL

export GATEWAY_URL=$(kubectl get po -l istio=ingress -o jsonpath={.items[0].status.hostIP}):$(kubectl get svc istio-ingress -o jsonpath='{spec.ports[0].nodePort}')

I encountered

error: name cannot be provided when a selector is specified
error: error executing jsonpath “{spec.ports[0].nodePort}”: unrecognized identifier spec
export: not valid in this context: template:
zsh: not an identifier: map[string]interface
zsh: not an identifier: map[string]interface

In order to figure out where the problem is, I quickly broke this single command in bunch of smaller commands and verified that there was no issue in producing JSON by executing:

kubectl get po -l istio=ingress -o json

Note: To see all the available options execute :

kubectl get po -l istio=ingress -o

My small investigation lead me to believe that the culprit was jsonpath. After some initial research I came across a github issue, after reading one of the comments made by Justin Garrison:

I was upgrading to 1.3.0 and was going to test when @2opremio made me realize zsh has a built in to expand (usually numbers) inside { }
Just opened #1651 with quotes to fix it. Tested on bash and zsh. Thanks for the help debugging everyone, sorry for the trouble.

It was clear that issue was ZSH specific, after applying the suggested solution

export GATEWAY_URL=$(kubectl get po -l istio=ingress -o jsonpath='{.items[0].status.hostIP}'):$(kubectl get svc istio-ingress -o jsonpath='{spec.ports[0].nodePort}')

Still I was receiving bunch of errors

error: error executing jsonpath “{spec.ports[0].nodePort}”: unrecognized identifier spec
export: not valid in this context: template:
zsh: not an identifier: map[string]interface
zsh: not an identifier: map[string]interface

Digging a bit deeper, lead me to change the syntax of the original command

export GATEWAY_URL=$(kubectl get po -l istio=ingress -o jsonpath='{.items[0].status.hostIP}'):$(kubectl get svc istio-ingress -o jsonpath='{.spec.ports[0].nodePort}')

And finally, everything worked, you can verify it by executing:

echo $GATEWAY_URL

Or just head over to the browser

bookstore

BookInfo – main page

2

BookInfo – Grafana metrics

Screen Shot 2017-05-25 at 13.49.14

BookInfo – Zipkin dashboard

3

BookInfo – Zipkin trace

4

BookInfo – generated graph

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s