Lab: Istio Kiali | Question 8: Now you can access the Kiali UI so let's try to deploy a simple app to see some data in kiali

Unable to enter the Kiali console. Performed the steps as suggested in Solution in previous questions. Could you please assist on what configs I may validate?

#### Kiali failed to initialize. Please ensure that services Kiali depends on, such as Prometheus, are healthy and reachable by Kiali then refresh your browser.

Where did you see the error? There are some issues with this lab – creating kiali via the addon yaml prevents you from creating the service in the next step, and you have to delete the old service – and kiali can be accessed by the link once you do that. What exactly did you do, and where did you get the error?

OK, now I see it. Here’s how to get this to work the next time you run the lab:

  1. enter the addons directory
  2. Just do k apply -f . and get all of the items in the directory.
  3. cd /root
  4. k apply -f kiali-svc.yml

This will get kiali to come all the way up.

Hey @rob_kodekloud ,

Thank you for the response. Could you please help me understand why do we perform apply for all the yaml files? k apply -f .
I guess this may be the reason it didn’t work for me as I performed kubectl apply for the kiali.yaml and not the whole dir. k apply -f kiali.yaml

Thank you in advance.

Yes, it checks out. I did two deployments - one with all files and another with just the kiali.yaml. Result: the first deployment helps access the Kiali UI yet the second one fails with same error as mentioned in the original post.

Could you please help me understand why it fails if I just apply the kiali.yaml. For your reference, sharing the deployment details below. let me know if you require additional details.

Thank you in advance.

Error ecnountered in deployment 2:

Kiali failed to initialize. Please ensure that services Kiali depends on, such as Prometheus, are healthy and reachable by Kiali then refresh your browser.

Deployment 1: All files

root@controlplane ~ ➜  kubectl apply -f istio-1.23.1/samples/addons/
serviceaccount/grafana created
configmap/grafana created
service/grafana created
deployment.apps/grafana created
configmap/istio-grafana-dashboards created
configmap/istio-services-grafana-dashboards created
deployment.apps/jaeger created
service/tracing created
service/zipkin created
service/jaeger-collector created
serviceaccount/kiali created
configmap/kiali created
clusterrole.rbac.authorization.k8s.io/kiali created
clusterrolebinding.rbac.authorization.k8s.io/kiali created
role.rbac.authorization.k8s.io/kiali-controlplane created
rolebinding.rbac.authorization.k8s.io/kiali-controlplane created
service/kiali created
deployment.apps/kiali created
serviceaccount/loki created
configmap/loki created
configmap/loki-runtime created
service/loki-memberlist created
service/loki-headless created
service/loki created
statefulset.apps/loki created
serviceaccount/prometheus created
configmap/prometheus created
clusterrole.rbac.authorization.k8s.io/prometheus created
clusterrolebinding.rbac.authorization.k8s.io/prometheus created
service/prometheus created
deployment.apps/prometheus created
root@controlplane ~ ➜  kubectl apply -f kiali-svc.yml 
service/kiali configured
service/prometheus configured
root@controlplane ~ ➜  kubectl apply -f redis/
deployment.apps/redis-master created
service/redis-master created
deployment.apps/redis-slave created
service/redis-slave created

Deployment 2: just the kiali.yaml

root@controlplane ~ ➜  kubectl apply -f istio-1.23.1/samples/addons/kiali.yaml 
serviceaccount/kiali created
configmap/kiali created
clusterrole.rbac.authorization.k8s.io/kiali created
clusterrolebinding.rbac.authorization.k8s.io/kiali created
role.rbac.authorization.k8s.io/kiali-controlplane created
rolebinding.rbac.authorization.k8s.io/kiali-controlplane created
service/kiali created
deployment.apps/kiali created
root@controlplane ~ ➜  kubectl apply -f kiali-svc.yml 
service/kiali configured
service/prometheus created

The real dependency turns out to be on prometheus; if prometheus isn’t up, kiali won’t come up either. So you probably could do something like this:

  • k apply -f prometheus.yaml
  • k apply -f kiali.yaml

The order mattering here; I did all of the directory simply because it’s fast and easy. But the problem here was the lack of prometheus.