I have istio version 1.9 installed. I have deployed kiali and I am trying to access kiali, but when I try to forward it gives me an error.
How can I configure it, will you help me please?
type → kiali is → clusterIP
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S)
kiali ClusterIP 1.x.x.x 20001/TCP,9090/TCP
./istioctl d kiali → error
Unable to listen on port 20001: Listeners failed to create with the following errors: [unable to create listener: Error listen tcp4 127.0.0.1:20001: bind: address already in use unable to create listener: Error listen tcp6 [::1]:20001: socket: address family not supported by protocol] http://localhost:46633/kiali
Failed to open browser; open http://localhost:46633/kiali in your browser.
kubectl -n istio-system port-forward svc/kiali 20001:20001 → error
Unable to listen on port 20001: Listeners failed to create with the following errors: [unable to create listener: Error listen tcp4 127.0.0.1:20001: bind: address already in use unable to create listener: Error listen tcp6 [::1]:20001: socket: address family not supported by protocol]
error: unable to listen on any of the requested ports: [{20001 20001}]
The error “bind: address already in use” is a common error, and it means you have something listening on port 20001 already. You must find out what is listening to port 20001 on localhost and kill it. Without killing whatever is listening on 20001, those commands you are trying to run will never work.
To confirm you already have something on your local host listening at port 20001, try this test (note this is just using the simple Linux utility “nc” - make sure you have that utility available to you, feel free to install it yourself if you do not have nc on your machine - but you probably do, most Linux machines have it by default).
Run the command: nc -l localhost 20001
If you see an error print out immediately that says something like “Ncat: bind to ::1:20001: Address already in use. QUITTING.” then my hypothesis is correct and you must find out what is listening to 20001 and kill it (it could be anything - you must investigate on your machine and find it and kill it).
Failed to open browser; open http://localhost:20001/kiali in your browser.
Sounds like your system doesn’t have the necessary utilities to launch the browser from istioctl. You haven’t mentioned what your environment is - what operating system? What kubernetes cluster environment? You can see here that the operating system is what determines what utility istioctl will try to use to launch the browser - xdg-open on Linux (I’ll assume you are on Linux, though, again, you didn’t specify). So if you do not have xdg-open (or whatever utility your specific operating system needs) then you will get that error you see.
In that case, just start the browser on your machine manually and point it to the URL the istioctl output tells you to point to (open http://localhost:20001/kiali in your browser.) - did you point your browser to that URL? What did your browser say?
You should not need a Gateway if you are port-forwarding directly. But if you want to expose Kiali with a gateway, follow the full instructions on how to do that correctly - you can find the docs here: Istio / Remotely Accessing Telemetry Addons
I answer your questions. It is a kuberntes cluster environment with linux operating system, the problem is that I think I am not forwarding the ports well. Try this, but not with much success.
hi jmazzitelli,
good news ! . kiali already works, now what does not work for me is prometheus with the error, Could not fetch health: Error while fetching app health: Post “http: //prometheus.istio-system: 9090 / api / v1 / query”: dial tcp : lookup prometheus.istio-system on 10.xxx:x: no such host.
Hi Jmazzitelli ,
I saw the error in kiali. The error is because I am trying to configure kiali so that it can use external prometheus and grafana from another cluster.
I already have prometheus and grafana running but in another cluster. So in order not to use several, I would like to configure kiali to take them from the other cluster. Can you help me configure it up?. its possible ?
All I can say is read the documentation in the example kiali_cr.yaml that I linked to earlier - those are all the config settings it supports. You’ll need to make sure Prometheus is exposed properly (so it is reachable from the Kiali pod) and configure Kiali appropriately. I’ve never deployed Prometheus in one cluster while Kiali is in a completely different cluster - I’ve never heard of such a deployment before. Usually Istio, Prometheus and Kiali are all in the same cluster (most times even in the same namespace in the same cluster). You will have to do some custom configuration to get all of that to work. Sorry, that’s all I know.
hi Jmazzitelli,
I’ve been investigating and I think the solution to my case would be to install istio-operator? , to be able to configure external grafana and prometheus?
I only have installed → samples/addons/kiali.yaml
But , Is there any way that I can display some .yaml file so that I can declare this data?. how to do it ?.
I think this is the solution to my problem. but I don’t know how to install it.
You are doing something I have never done – putting Kiali in a completely different cluster than where Istio is deployed. So I can’t help other than tell you to read the docs and configure your clusters so they expose the different services externally (Prometheus, Grafana, etc). Those Kiali external_services URLs must be the URLs that can connect the Kiali pod in one cluster to the Prometheus/Grafana/etc pod in the other cluster.
Side note: looking at the URLs you posted, they have “maistra” in them - are you actually using Maistra (the upstream version of OpenShift Service Mesh)?? Kiali installation is very different in Maistra compared to the Istio installation using istioctl. I suspect, though, you just found those on the internet somewhere as examples. In any event, if you are using Maistra (aka OpenShift Service Mesh) be aware Kiali install is very different and you should read the Maistra/OpenShift Service Mesh docs to know how to do it.
hi jmazzitelli.
Let’s see that I have explained myself wrong. I have istio and kiali on the same server, so I need to know how and where to configure external urls to be able to connect the kiali, prometheus and grafana pod through urls from other clusters.
I explain better and forgive me ;
I have a cluster 1, where I have istio and kiali installed.
on the other hand, I have in another cluster the services of prometheus and grafana.
and them , what I want to configure is from cluster 1 the urls of grafana and prometheus of cluster2. Just the urls.
-result :
cluster 1, configured with istio and kiali with the urls of grafana and prometheus. So as not to have repeated monitoring. and then also to be able to monitor for example bookinfo locally. ¿ its possible ?
and forgive me if I did not know how to explain myself, thank you very much
hi jmazzitelli.
can you help me please. I have reinstalled istio, I need to configure prometheus and grafana to collect external metrics, how do I configure it? . you help me ?
note , i know that Unreachable status means that Kiali hasn’t been succesfuly able to communicate with the component (Prometheus, Grafana) , but I don’t know how to solve it.
i believe that i need to personalize my Kiali installation telling where is located the prometheus and grafana services, but… how do i do it?
I do not know. As I said before, I have never installed addons in a place different from the default addons location, so I do not know how to do what you want to do.
You should start a new thread or ask in the #general room in Istio Slack. The subject of this thread is “error with istio-system port-forward svc to Kiali” and people who would know the answer probably will be ignoring this thread
As for the question: “i need to personalize my Kiali installation telling where is located the prometheus and grafana services, but… how do i do it?” - see these links for the settings you need to specify in your Kiali CR for Grafana and Prometheus - those personalize your Kiali installation to tell it where Prometheus and Grafana are located. If you know your cluster’s Prometheus and Grafana setup (which you should since you installed them), you should know the values you need. So read the comments and look at the settings there and it should be obvious what you need to set in order for Kiali to talk to Prometheus and Grafana
hi jmaziitelli,
I have managed to configure prometheus in istio, but when configuring the config.map of kiali the external services of grafana gives me unreachealble. But inside the pod if I curl if it arrives without problem. So I don’t know if I’m putting this part correctly.