I am having a very weird and frustrating issue with kibana. I am running the dockerhub elasticsearch and kibana containers on my kubernetes cluster. Here is the issue: I can run elasticsearch just fine, and also port forward port 9200 to a nodeport on my host machine and access elasticsearch via the browser, it prompts me to log in to elasticsearch, so I know it is working.
The issue is when i try to run kibana, i expose port 5601 and then create a nodeport to expose it on the host machine, but it just will not work, the browser just gives me a "ERR_CONNECTION_REFUSED". Now here is the weird part: when i run the kubernetes/docker container, i pass in the config options through environment variables (elastic host, username, password, etc.) and then it just works, i can access it through the browser no problem. But i would rather not put my config options in the environment variables, i would much rather use the kibana.yml file. So okay, i remove the env vars from my kubernetes file and add a file mount for the kibana.yml file and mount it to the container on path "/usr/share/kibana/config/kibana.yml". I can also exec into the container and see my file mounted at the correct location with the correct contents. But when i then try to access kibana through the browser i get the "ERR_CONNECTION_REFUSED" again. When i then check the kibana container logs there is absolutely nothing wrong at all, everything seems to be running. I then edited the kibana.yml file and added the line "logging.root.level: "trace"". I then restarted the container, and i know for sure that kibana is reading my mounted config file, because instead of just the info logs, it now shows all the logs (debug and trace). But then i go the the browser, and still no ui is loading. If i then remove the file mount from the kubernetes config and do it through the env vars again, the kibana ui works instantly again. The config between the vars and the kibana.yml file are exactly the same, no differences whatsoever. I don't understand the issue at all, there are also no differences in logs when i do it with env vars or with the config file mounted, but one will work in the browser, and the other won't for some reason.... I am running elasticsearch and kibana version 8.12.1 containers, anyone any idea?