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

12345 port is not open #308

Open
DnPlas opened this issue Jun 25, 2024 · 2 comments
Open

12345 port is not open #308

DnPlas opened this issue Jun 25, 2024 · 2 comments

Comments

@DnPlas
Copy link

DnPlas commented Jun 25, 2024

Bug Description

When trying to reach the /agent/api/v1/metrics/targets endpoint, I repeatedly got curl: (7) Failed to connect to 10.1.60.144 port 12345 after 0 ms: Connection refused error messages.

When looking at the Service of the application, it doesn't look like it is listed in PORT(S):

kubectl get svc -A | grep grafana
kubeflow              grafana-agent-k8s             ClusterIP   10.152.183.189   <none>        3500/TCP,3600/TCP            26m

Similarly, the juju status output does not show any Ports:

grafana-agent-k8s/0*  blocked   idle   10.1.60.144                 grafana-cloud-config: off, logging-consumer: off

This suggests that the port is not open.

Workaround

The port is just not open, so we can still reach the desired endpoint from within the unit:

juju ssh grafana-agent-k8s/0 curl localhost:12345/agent/api/v1/metrics/targets

To Reproduce

  1. juju deploy grafana-agent-k8s --channel latest/stable
  2. curl -v <unit IP>:12345/agent/api/v1/metrics/targets
  3. See error

Environment

juju 3.5.1
microk8s 1.29

Relevant log output

curl -v 10.1.60.144:12345/agent/api/v1/metrics/targets
*   Trying 10.1.60.144:12345...
* connect to 10.1.60.144 port 12345 failed: Connection refused
* Failed to connect to 10.1.60.144 port 12345 after 0 ms: Connection refused
* Closing connection 0
curl: (7) Failed to connect to 10.1.60.144 port 12345 after 0 ms: Connection refused
ubuntu@ip-172-31-15-25:~$ juju status grafana-agent-k8s
Model     Controller  Cloud/Region        Version  SLA          Timestamp
kubeflow  uk8s-351    microk8s/localhost  3.5.1    unsupported  20:38:37Z

App                Version  Status   Scale  Charm              Channel        Rev  Address         Exposed  Message
grafana-agent-k8s  0.32.1   waiting      1  grafana-agent-k8s  latest/stable   45  10.152.183.189  no       installing agent

Unit                  Workload  Agent  Address      Ports  Message
grafana-agent-k8s/0*  blocked   idle   10.1.60.144         logging-consumer: off, grafana-cloud-config: off

Additional context

No response

@lucabello
Copy link
Contributor

This has partly been addressed by open_ports in #289, which landed in Revision 71.

The missing step is to bind 0.0.0.0 instead of localhost in the config/layer.

@simskij
Copy link
Member

simskij commented Oct 26, 2024

@lucabello:

I'm not sure whether we want to expose this port externally as it comes with quite some security implications that we've yet to assess.

@DnPlas:

Why do you need this?

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

3 participants