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

2 nodes with same hostname bug #13999

Closed
Razikus opened this issue Jun 14, 2018 · 5 comments
Closed

2 nodes with same hostname bug #13999

Razikus opened this issue Jun 14, 2018 · 5 comments
Assignees
Labels
kind/bug Issues that are defects reported by users or that we know have reached a real release
Milestone

Comments

@Razikus
Copy link

Razikus commented Jun 14, 2018

Rancher versions : 2.02
Docker version: (docker version,docker info preferred) 17.03.2-ce
PRETTY_NAME="Debian GNU/Linux 9 (stretch)"
NAME="Debian GNU/Linux"
VERSION_ID="9"
VERSION="9 (stretch)"
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"
4.9.0-6-amd64
same hostname

Steps to Reproduce:

  1. Create custom cluster
  2. Make sure that your nodes have same /etc/hostname
  3. Add first node with role ALL and hostname example (ip 192.168.0.1)
  4. Add second node with role WORKER and hostname example (ip 192.168.0.2)

Results:
There will be node example with ip 192.168.0.1 (first node) and role WORKER. Cluster will be active!

@antoniojtorres
Copy link

+1 - Using bare metal servers that come with the same hostname from image caused this as well, once I edited the host file and rebooted, I was able to add a second custom node without issue.

@loganhz loganhz assigned loganhz and unassigned loganhz Jul 25, 2018
@loganhz loganhz added version/2.0 kind/enhancement Issues that improve or augment existing functionality labels Jul 30, 2018
@superseb superseb added kind/bug Issues that are defects reported by users or that we know have reached a real release and removed kind/enhancement Issues that improve or augment existing functionality labels Aug 2, 2018
@superseb superseb added this to the v2.0.7 milestone Aug 2, 2018
@FinlayDaG33k
Copy link

@antoniojtorres that seems to be a working band-aid.
For those using RancherOS this can be done using sudo ros config set hostname <hostname> followed by a reboot.

@galal-hussein
Copy link
Contributor

@Razikus kubernetes can't have duplicate node names, you can however append the option --node-name to the registration command to include the node name, for example:

sudo docker run -d --privileged --restart=unless-stopped --net=host -v /etc/kubernetes:/etc/kubernetes -v /var/run:/var/run rancher/rancher-agent:master --server https://x.x.x.x --token xxxxxx --ca-checksum xxxxx --etcd --controlplane --worker --node-name <node-name>

@loganhz i am assigning the issue to you so that the option can be included to the UI like the Public Address and Internale Address

@westlywright
Copy link
Contributor

ui@latest has been built and updated

@deniseschannon deniseschannon modified the milestones: v2.0 - Sep, v2.1 Aug 21, 2018
@soumyalj
Copy link

soumyalj commented Sep 6, 2018

Tested with master. The UI has option to add node name in advanced options.
Deployed nodes 3 which have the same hostnames. Created custom cluster using these nodes, and used --node-name option with names other than the real hostnames. The cluster got created successfully with all the nodes in active state
screen shot 2018-09-06 at 2 23 39 pm

In Kubernetes, each node has to have a unique name. Hence using --node-name option allows adding different names to the nodes even though all the nodes have the same hostname.

@soumyalj soumyalj closed this as completed Sep 6, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Issues that are defects reported by users or that we know have reached a real release
Projects
None yet
Development

No branches or pull requests

10 participants