-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Remove hostname requirement in /etc/hosts
#750
Remove hostname requirement in /etc/hosts
#750
Conversation
I just want to confirm that |
The reason that node name is set there has to do with how the tunnel server discovers the nodes. |
Testing shows that exec/logs/attach/port-forward work with this change. In the tunnel we set the node name here https://github.com/rancher/k3s/blob/master/pkg/agent/tunnel/tunnel.go#L170, Using the example from https://kubernetes.io/docs/tasks/access-application-cluster/port-forward-access-application-cluster/, if there is not an entry in hosts for
That failure is on master and with this change, and is probably an upstream issue in the portforward code that should be fixed. This is an issue for the default configuration of Alpine 3.10 in the Vagrantfile I am using. Also added a commit to prefer "127.0.0.1" over "localhost" for our connection strings, which will help if there is a missing |
Hmmm.... I'd like to review this one a bit further because something must have change that I don't understand regarding exec. AFAIK exec should be broken. |
@erikwilson Can you confirm exec works with a multi node cluster where the pod you are execing to is not on the same server as the master. |
Running with 2 nodes from the Vagrantfile in k3s, on master (hostname k3s-1) I ran k3s with the following command: K3S_NODE_NAME=k3s-master \
K3S_CLUSTER_SECRET=test \
INSTALL_K3S_SKIP_DOWNLOAD=true \
./install.sh --flannel-iface eth1 and then an agent (hostname k3s-2) with the following command: K3S_URL=https://10.135.135.101:6443/ \
K3S_NODE_NAME=k3s-worker \
K3S_CLUSTER_SECRET=test \
INSTALL_K3S_SKIP_DOWNLOAD=true \
./install.sh --flannel-iface eth1 Nodes ready:
Launching an example pod:
Exec and showing info, resolving node ip from inside a pod:
content of hosts:
and unresolvable hostnames from host vm:
Network info:
|
Awesome! |
Fixes #60
Closes #91
Resolves #193
Resolves #299