Open putcn opened 7 years ago
i have an idea regarding this issue. Since we are trying not to assign static ip addresses for those machines who have special roles( kube master, etcd memeberes, etc.), we can dynamically add hostname and ip address to dnsmasq's hosts file by utilizing dnsmasq's dhcp_script and hostsdir.
Whenever a machine joins the network and asks for an ip address. dhcp_script will be called with the ip assigned to it, the machine's mac address, etc. we can maintain the hosts mapping file with this info and cluster-desc.yaml's predefined node list (either with host name converted from mac, or with predefined cur_host_name). dnsmasq will refresh its nameservice when the hosts file changed.
after this, whenever another machine is trying to reach this one with hostname, this name will be resolved by dnsmasq and return with proper ip.
let me do some investigations and hopefully come up with a PR
I think this may be a minor enhancement. We have many cases that the cluster is already there and we only need to bootstrap kubernetes and ceph etc.
I agree, and this is why there is a fabric version I guess? here are my 2 cents: if the user chose to use the original version of the sextant, that means he would like to rely on sextant's dhcp which means he has a very basic and bare network env. in this case, only dhcp is not sufficient to bring up a cluster e2e. that's why I would like to add a name service to the original version. but you are right, in most of the case, cluster would already have the dhcp, name service, etc. ready in the network, this update would not mean that much for real users in production. I just want to close the ring for original version user, so that they wouldn't be stuck somewhere.
Is there some quick fix for this issue? I would prefer a quick fix for this:
dnsmasq
does not suit large cluster deployment due to lack of HA hand poor performance. If user choose to use dnsmasq
we definitely need a reliable name server.i've worked out a working example in my virtual box deployment. Hopefully, I can create a PR by end of today for this update. I agree with your comments regarding dnsmasq's reliability and performance issue. Since the original version is only targeting experimenting or really small scale cluster, I think we are at least good at this point with the fix I'm working on, but we do need to document the limitations in readme. I don't quite understand your 2nd comment, don't we already have fiber version for the case you mentioned?
ah, I see what you saying, you mean quicky deploy k8s in clusters which already have os installed? I tried kubeadm, pretty neat. the only downside is: it's still in early alpha, not sure if that can be used in production.
after manually start dnsmasq in container, now cluster workers are able to boot and install. but after worker rebooted, I'm not able to config kubectl to connect to k8s api server.
First issue is: looks like the vars defined there are not properly substituted in setup_kubectl.bash with my cluster-desc.yaml. like KUBE_MASTER_HOSTNAME, it was 00-25-90-c0-f7-80, but it supposed to be 08-00-27-00-B2-98 or kube-master as in my yaml file. And also the BS_IP, which is wrong. I tracked common.sh, looks it should have worked properly, but still, the output is wrong, not sure why.
Then I manually updated these vars, it still does not work. kube-master names are not resolved by dnsmasq. "kube-master" or "08-00-27-00-B2-98" is supposed to be resolved by dnsmasq to IP address, but I don't see these names are defined anywhere, and I checked dnsmasq.conf, it does have a setting for addn-hosts=/bsroot/config/dnsmasq.hosts, but there isn't such a file in config folder. how is name service defined if this host file is not generated?
my cluster-desc.yaml is as follows