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

Support unix socket in client #18099

Closed
SamMousa opened this issue Jul 31, 2023 · 1 comment · Fixed by #16872
Closed

Support unix socket in client #18099

SamMousa opened this issue Jul 31, 2023 · 1 comment · Fixed by #16872
Labels
theme/api HTTP API and SDK issues type/enhancement

Comments

@SamMousa
Copy link
Contributor

Proposal

The go API client doesn't support unix sock, I tested this by testing the CLI:

NOMAD_ADDR=unix://$(pwd)/api.sock nomad agent-info
Error querying agent info: failed querying self endpoint: Get "unix:///v1/agent/self?namespace=cluster": unsupported protocol scheme "unix"

Use-cases

The recently added api.sock unix socket is great, I'd like to be able to use it Traefik service discovery: traefik/traefik#10044

Attempted Solutions

An alternative would be to expose the unix socket as a tcp socket, but this requires yet another proxy process. Also to do this securely I'd need to have both processes (containers in my case) run in the same network space; it gets complicated quickly.

Currently I use this: http://host.docker.internal:4646 but that only works because my current 3 nodes are both clients and servers.
I can't use a public URL since that is one of the things traefik is reverse-proxying for me.

I inspected the Traefik source code, and all they do is import your API client and set its address config option, which is what leads me to believe this issue should be in this tracker.

@tgross
Copy link
Member

tgross commented Jul 31, 2023

Hi @SamMousa we've already got a PR open for that: #16872 It's been approved but I think @angrycub just had a few more tweaks he wanted to do before we merge it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
theme/api HTTP API and SDK issues type/enhancement
Projects
Development

Successfully merging a pull request may close this issue.

2 participants