无法在Kubernetes中添加Grafana Loki数据源

6tqwzwtp  于 2022-12-11  发布在  Kubernetes
关注(0)|答案(1)|浏览(696)

I am following the following grafana documentation on loki. I am unable to properly connect to my k8s clusters loki logs after installing loki, promtail, and grafana via helm charts. When I enter the http: url in Add datasources within the Grafana GUI and proceed to save & test, grafana is unable to connect to loki.
My helm commands are:

helm upgrade --install --namespace=monitoring promtail grafana/promtail --set "loki.serviceName=loki"
helm upgrade --install loki --namespace=monitoring grafana/loki-distributed
helm install --namespace=monitoring loki-grafana grafana/grafana

Now I mainly am having trouble with this step and the syntax and how to debug the process: "using the URL http://helm-installation-name-gateway.namespace.svc.cluster.local/ for Loki (with and replaced by the installation and namespace, respectively, of your deployment)."
I have tried all of the following URLs with no luck, any guidance would be very appreciated!

http://loki-grafana.monitoring.svc.cluster.local:3100

Unable to fetch labels from Loki (Failed to call resource), please check the server logs for more details

bpzcxfmw

bpzcxfmw1#

我想出来了

helm repo add loki https://grafana.github.io/loki/charts
helm repo update
kubectl create namespace monitoring
helm upgrade --install loki --namespace=monitoring grafana/loki-stack
helm upgrade --install grafana --namespace monitoring grafana/grafana
kubectl get secret --namespace monitoring grafana -o jsonpath="{.data.admin-password}" | base64 --decode ; echo
kubectl port-forward --namespace loki service/grafana 3000:80

然后,当您登录到grafana时,使用http://loki:3100作为数据源URL
我找到的指南在这里:https://medium.com/codex/setup-grafana-loki-on-local-k8s-cluster-minikube-90450e9896a8
我只是跳过了minikube和入口的东西

相关问题