Toying with Knative on Istio and Kiali

Heiko W. Rupp
3 min readSep 28, 2018

--

Excerpt from the Kiali graph showing the helloworld-php application

So as Knative builds on Istio, I was interested on how this would look with Kiali. I followed the installation guide for Knative, that my colleague Kamesh has pimped to work on minishift. Afterwards I installed Kiali and directly saw the new namespaces of Knative.

Kiali overview page with the namespaces. Knative ones start with knative- 😀

I also installed the helloworld-php example. And as I did not pay attention it first landed in the ‘default’ namespace, that should not be used in OpenShift for user deployments. I deleted that and re-installed into ‘myproject’.

As I saw the example deployed and also figured out how to call that (actually I asked Kamesh and he pointed me to this little script (I needed to replace greeter with ‘helloworld-php’), I did get my first hello world response on Knative. Nice.

Now I wanted to see the graph, but this failed miserably with an error saying that Kiali can’t contact Prometheus. Investigating revealed that there is indeed the normal Prometheus in the ‘istio-system’ namespace missing 😱

I found a Prometheus instance in the ‘knative-monitoring’ namespace which seemed to have the telemetry of Istio. To use this in Kiali, one needs to set the environment variable PROMETHEUS_SERVICE_URL to that Prometheus instance (http://prometheus-system-np.knative-monitoring.svc.cluster.local:8080).

OKD console with the Env-Variable section to set the Prometheus URL

Now that Kiali can pull stats from Prometheus it can also create the graph.

Kiali-Graph of the istio-system namespace

One can see there is a lot going on and the amount of traffic and connections here shows more about the inner workings of Knative than about our application. There is one red box in the graph. This is the version that I accidentally deployed into the ‘default’ namespace. As my setting was to show data for the last hour or so, Kiali correctly shows that this existed and that it is no longer there now (and thus marked as missing).

Switching to the graph for the ‘myproject’ namespace reveals this:

Kiali graph with service nodes enabled.

Incoming requests flow through the knative-ingress-gw to the helloworld-php-000001 service (1st revision), which then forwards it to the workload with the almost same name. One can also see the other components in knative-serving that were involved to stand up the workload and service.

So far this all looks good. There are some smaller issues that show up when browsing through the Kiali console e.g. should the entities from knative-serving really show up in the above graph or Kiali is showing a warning that no version=X label is present on the workload, while Knative is using its own way of labeling.

Warning in the Workload details

But I am pleased, that Kiali can directly show what is happening inside of Knative.

--

--

Heiko W. Rupp
Heiko W. Rupp

Written by Heiko W. Rupp

Long time Open Source developer, currently working at Red Hat. Find me also at https://mastodon.social/@pilhuhn

No responses yet