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

Use unix socket for etcd listen address #104

Open
jnummelin opened this issue Aug 24, 2020 · 13 comments
Open

Use unix socket for etcd listen address #104

jnummelin opened this issue Aug 24, 2020 · 13 comments

Comments

@jnummelin
Copy link
Member

No need to listen on external address, each api server can connect to local etcd only. We can use local unix sockets too if that works for both etcd and api-server. (it should but there's a history of issues related)

@jnummelin jnummelin added this to the 0.4.0 milestone Sep 8, 2020
@jnummelin jnummelin assigned jnummelin and unassigned jnummelin Sep 15, 2020
@jnummelin
Copy link
Member Author

Seems there's some missing bits and pieces in etcd side to really be able to use unix sockets: etcd-io/etcd#11747

Let's move this bit further and re-visit once things are better supported in upstream etcd.

@jnummelin jnummelin modified the milestones: 0.4.0, 0.5.0 Sep 15, 2020
@mikhail-sakhnov
Copy link
Contributor

Hm, but based on the code, it's already listens on 127.0.0.1 only?

	args := []string{
		fmt.Sprintf("--data-dir=%s", e.etcdDataDir),
		"--listen-client-urls=https://127.0.0.1:2379",
		"--advertise-client-urls=https://127.0.0.1:2379",
		"--client-cert-auth=true",
		fmt.Sprintf("--listen-peer-urls=%s", peerURL),
		fmt.Sprintf("--initial-advertise-peer-urls=%s", peerURL),
		fmt.Sprintf("--name=%s", name),
		fmt.Sprintf("--trusted-ca-file=%s", path.Join(e.certDir, "ca.crt")),
		fmt.Sprintf("--cert-file=%s", path.Join(e.certDir, "server.crt")),
		fmt.Sprintf("--key-file=%s", path.Join(e.certDir, "server.key")),
		fmt.Sprintf("--peer-trusted-ca-file=%s", path.Join(e.certDir, "ca.crt")),
		fmt.Sprintf("--peer-key-file=%s", path.Join(e.certDir, "peer.key")),
		fmt.Sprintf("--peer-cert-file=%s", path.Join(e.certDir, "peer.crt")),
		"--peer-client-cert-auth=true",
	}

@jnummelin
Copy link
Member Author

Hm, but based on the code, it's already listens on 127.0.0.1 only?

yes, but our intention is to make it listen only a unix socket. need to update the issue title... :)

@jnummelin jnummelin changed the title Use local address for etcd listen address Use unix socket for etcd listen address Oct 8, 2020
@jnummelin jnummelin modified the milestones: 0.5.0, 0.6.0 Oct 8, 2020
@mikhail-sakhnov
Copy link
Contributor

should we have it for current (0.6.0) milestone? It seems to be blocked on the issue in the etcd repo which has no activity for a while. I ping the original author of the etcd issue if he is going to reiterate on the PR but now we can't really do anything in the mke.

@jnummelin
Copy link
Member Author

Seems the upstream PR is still blocked, moving forward

@jnummelin jnummelin modified the milestones: 0.6.0, 0.7.0, 0.8.0 Oct 22, 2020
@trawler
Copy link
Contributor

trawler commented Nov 12, 2020

because the upstream PR seem to be stale, I opened etcd-io/etcd#12469

@ncopa ncopa modified the milestones: 0.8.0, 0.9.0 Nov 27, 2020
@jnummelin jnummelin modified the milestones: 0.9.0, 0.10.0 Dec 16, 2020
@jnummelin jnummelin modified the milestones: 0.10.0, 0.11.0 Jan 15, 2021
@unixfox
Copy link

unixfox commented Feb 15, 2021

Will I still be able to force listening on an IP address? For example if I need to port forward the etcd port using SSH for remote diagnose with the etcd cli then this could come handy to have etcd listening an IP address instead of a UNIX socket.

@jnummelin
Copy link
Member Author

Will I still be able to force listening on an IP address?

Probably not. We really want to "hide" etcd from external access for security reasons of course.

if I need to port forward the etcd port using SSH for remote diagnose

AFAIK you can do the same for unix sockets. Something like ssh -R /tmp/remote_socket:1234:somehost user@remote_host

@jnummelin jnummelin modified the milestones: 0.11.0, 1.0.0 Feb 23, 2021
@jnummelin
Copy link
Member Author

Bumbed to next milestone as we're still waiting for the upstream PR to land...

@jnummelin
Copy link
Member Author

Still waiting on upstream, removing from milestone

@jnummelin jnummelin removed this from the 1.21+k0s.0 milestone Apr 27, 2021
@mikhail-sakhnov
Copy link
Contributor

looks like upstream PR requests some changes (add more tests)

etcd-io/etcd#12469

@github-actions
Copy link
Contributor

The issue is marked as stale since no activity has been recorded in 30 days

@github-actions github-actions bot added the Stale label Dec 28, 2021
@kke kke removed the Stale label Dec 29, 2021
@github-actions
Copy link
Contributor

The issue is marked as stale since no activity has been recorded in 30 days

@github-actions github-actions bot added the Stale label Jan 28, 2022
@jnummelin jnummelin removed the Stale label Jan 31, 2022
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

6 participants