Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Loki datasource is not reachable from Grafana when using a domain name in Traefik #387

Closed
Abuelodelanada opened this issue Apr 24, 2024 · 1 comment

Comments

@Abuelodelanada
Copy link
Contributor

Bug Description

Grafana can't connect to Loki because the fqdn is provided to Grafana instead of the k8s svc DNS.

image

This issue was initialy reported by @kian99 in this chat

To Reproduce

  1. Deploy cos-lite : juju deploy cos-lite --channel=edge --trust
  2. Config external hostname: juju config traefik external_hostname=foobar.com
  3. Add this line to you /etc/hosts: 192.168.1.250 foobar.com (check what is Traefik external IP)
  4. Check in Grafana thar you cannot connect to Loki datasource.

Environment

  • juju 3.4.2
  • edge charms
Model  Controller  Cloud/Region        Version  SLA          Timestamp
cos    microk8s    microk8s/localhost  3.4.2    unsupported  15:31:49-03:00

App           Version  Status  Scale  Charm             Channel      Rev  Address         Exposed  Message
alertmanager  0.27.0   active      1  alertmanager-k8s  latest/edge  109  10.152.183.45   no       
catalogue              active      1  catalogue-k8s     latest/edge   39  10.152.183.232  no       
grafana       9.5.3    active      1  grafana-k8s       latest/edge  111  10.152.183.218  no       
loki          2.9.5    active      1  loki-k8s          latest/edge  137  10.152.183.67   no       
prometheus    2.50.1   active      1  prometheus-k8s    latest/edge  176  10.152.183.28   no       
traefik       v2.11.0  active      1  traefik-k8s       latest/edge  182  192.168.1.250   no       

Unit             Workload  Agent  Address      Ports  Message
alertmanager/0*  active    idle   10.1.165.8          
catalogue/0*     active    idle   10.1.165.1          
grafana/0*       active    idle   10.1.165.30         
loki/0*          active    idle   10.1.165.62         
prometheus/0*    active    idle   10.1.165.23         
traefik/0*       active    idle   10.1.165.24  

Relevant log output

.

Additional context

No response

@Abuelodelanada
Copy link
Contributor Author

Closing, since there was an error in step 3.
If you add that line to grafana container /etc/hosts it is working:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant