-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Embedded etcd server ignores --advertise-address flag #2965
Comments
This is by design. At the moment, the embedded etcd only communicates via the private network addresses. At some point in the future we may advertise multiple addresses for each node to support control-plane nodes without lan connectivity, but that will require more QA to support than we wanted to allow for initially. |
Thank you for your reply. |
I'm going to leave this open so that we can track it as a feature request. |
This would be great as I have some devices with multiple NICs and it's trying to use the wrong one |
This is an issue trying to set up a purely ipv6 cluster too. The issue I'm experiencing here is both that the wrong IP address on the interface/LAN is chosen (the interface has two addresses on this network) and I have no way of overriding it, as well as not handling the actual ipv6 address properly.
|
Same here, it's using the public ips, even through I specify both node-ip, node-external-ip, and advertise-address as local ips, it does not take those in consideration!
|
@mysticaltech please see the statement at #2965 (comment) |
@brandond Thanks, yes saw that, but the problem is that I WANT it to communicate on private IPs, but now it is choosing public ones!! |
Ah I see, you have multiple interfaces and it's not picking the one you'd like? Setting the |
I did that, for --node-ip, --node-external-ip, --advertise-address, and --tls-san, all set to the internal ip, and it still picked up the external one 🤯 However, I'm using Cilium as CNI, could that be the cause? |
Will try sticking to only --node-ip and increase log verbosity, see if something shows up huh, thanks for the tip 🙏 Maybe what I did was overkill, and it did not work because of it?! Will report back. |
@brandond You were right, I tried again, this time carefully reading to see which option go in for servers and which are to be used for agents, then I set:
And it worked like a charm! Thanks again for the support! ✨ For those interested in seeing the details of my working config, it's all open-source here https://github.com/mysticaltech/kube-hetzner. |
@mysticaltech i can can confirm that the embedded etcd has some strange behavior: the |
Environmental Info:
K3s Version:
Node(s) CPU architecture, OS, and Version:
Cluster Configuration:
One k3s server with an embedded etcd server, a local 10.x.x.x network interface and an external IP address (51.x.x.x)
Another k3s server trying to join the cluster
Describe the bug:
Embedded etcd server advertises server's private IP address and ignores --advertise-address flag.
Steps To Reproduce:
Server 1 has an internal IP address (10.x.x.x) and a public IP address (51.x.x.x ) that it is accessible through.
K3S server has been installed with
--cluster-init --node-external-ip 51.x.x.x --advertise-address 51.x.x.x
Server 2 (outside the 10.x.x.x network) is trying to join with
--server https://51.x.x.x:6443/
but the installation hangs.Expected behavior:
Server 2 is expected to be able to join the cluster. Etcd server on Server 1 is expected to use --advertise-address flag or a separate --etcd-advertise-address flag) and advertise server's external IP address.
Actual behavior:
Installation hangs as Server 2 is unable to connect to Server 1's etcd server.
Additional context / logs:
Server 1 logs:
Feb 15 14:44:43 XXXXX k3s[596166]: {"level":"info","ts":"2021-02-15T14:44:43.535+0100","caller":"embed/etcd.go:302","msg":**"starting an etcd server"**,"etcd-version":"3.4.13","git-sha":"Not provided (use ./build instead of go build)","go-version":"go1.15.5","go-os":"linux","go-arch":"amd64","max-cpu-set":2,"max-cpu-available":2,"member-initialized":true,"name":"ams-2-4b4052db","data-dir":"/var/lib/rancher/k3s/server/db/etcd","wal-dir":"","wal-dir-dedicated":"","member-dir":"/var/lib/rancher/k3s/server/db/etcd/member","force-new-cluster":false,"heartbeat-interval":"500ms","election-timeout":"5s","initial-election-tick-advance":true,"snapshot-count":100000,"snapshot-catchup-entries":5000,"initial-advertise-peer-urls":[**"http://localhost:2380"**],"listen-peer-urls":["**https://10.x.x.x:2380**"],"advertise-client-urls":["https://10.x.x.x:2379"],"listen-client-urls":["https://10.x.x.x:2379","https://127.0.0.1:2379"],"listen-metrics-urls":["http://127.0.0.1:2381"],"cors":["*"],"host-whitelist":["*"],"initial-cluster":"","initial-cluster-state":"ne
Server 2 is trying to connect to Server 1's internal IP address (10.x.x.x):
Feb 20 10:43:55 gce-2 k3s[7750]: {"level":"warn","ts":"2021-02-20T10:43:55.095Z","caller":"etcdserver/cluster_util.go:76","msg":"failed to get cluster response","address":"https://10.x.x.x:2380/members","error":"Get \"https://10.x.x.x:2380/members\": dial tcp 10.x.x.x:2380: i/o timeout"}
The text was updated successfully, but these errors were encountered: