Istio with minikube On Windows pt 2
Understand how your services connect under the hood
If you haven’t been following along, here is a link to Part 1, which is a prerequisite.
If you have been following along, you have installed minikube, and Istio is running with a hello-world webapp. Along with the installation of Istio, you also get Kiali, Prometheus, and Grafana. Let’s briefly go over each tool to see what you can get right “out of the box”.
Kiali
You need to be able to connect to your Kiali instance. Kiali is an observability tool of your mesh network. It helps you identify how all of your services are connected.
The easiest way for me to connect to the Kiali web interface was to port-forward to the pod. First, you get the pod name, then use that to forward the port to it.
kubectl -n istio-system get pod -l app=kiali -o jsonpath='{.items[0].metadata.name}'kubectl -n istio-system port-forward <pod name> 20001:20001
Open your browser to http://localhost:20001
You can find the credentials within the dashboard. Mine happen to be admin:admin
When you log in for the first time you will see this error, just ignore that.
If you still have the AirwaveTech hello-world webapp installed, trying mimicking some traffic by refreshing the page a few times. As you do that, you will start seeing items begin to populate on the Overview page in Kiali.
Navigate to Graph and set your Namespace. You should see the service graph.
And if you take a look at the istio-system namespace, you can see how traffic is routed.
Pretty slick isn’t it? This definitely will come in handy as your services begin to grow and you need to troubleshoot and can’t remember what connects to what.
Prometheus
Prometheus is an open-source real-time monitoring solution. It has become kind of the defacto standard in regards to monitoring Kubernetes and your services. You can monitor and send alerts for things like high cpu, failed nodes, etc.
Again, let’s port-forward so we can connect within the cluster.
kubectl -n istio-system get pod -l app=prometheus -o jsonpath='{.items[0].metadata.name}'kubectl -n istio-system port-forward <pod name> 9090:9090
Open your browser to http://localhost:9090
Type in kubernetes_build_info
to see what happens. It can get intricate from here on out. You can even add instrumentation to your application so you can set custom alerts.
Grafana
Grafana helps you visualize the things you are monitoring. The awesome thing about these tools is that they all work together. Since Grafana is a visualization tool, it will need to get its data from someplace. It can use Prometheus as a data source so you can then visualize your stats over time.
Let’s connect via port-forward
kubectl -n istio-system get pod -l app=grafana -o jsonpath='{.items[0].metadata.name}'kubectl -n istio-system port-forward <pod name> 3000:3000
Open your browser to http://localhost:3000
The dashboards here will be blank but you can import dashboard 8588 to see some metrics, instantly.
Try this link:
Using tools like Kiali, Prometheus, and Grafana get you a whole lot of visibility with just a little bit of effort. Hopefully, you won’t have to use these soon but if you do, drop me a line and tell me how they have helped save the day!
Stay tuned for Pt 3 of this series, when I cover how to start traffic shaping with Istio. Thanks again for reading.