How to setup HA when the masters have the same hostname?

9/26/2017

I'm trying to setup an HA cluster with 2 masters. The masters have the same hostname but different domain names, for instance: - foo.domain1.tld - foo.domain2.tld

We configured the high availability of the controller and scheduler with the option --leader-elect=true. And afaik the way it works is by setting a key in etcd (by default kube-scheduler). It can be seen in the scheduler logs

I0926 15:29:53.926628 1 event.go:218] Event(v1.ObjectReference{Kind:"Endpoints", Namespace:"kube-system", Name:"kube-scheduler", UID:"8b6d7117-a2cf-11e7-a32d-549f351a92e0", APIVersion:"v1", ResourceVersion:"3315810", FieldPath:""}): type: 'Normal' reason: 'LeaderElection' foo became leader

I checked the key directly into etcd and the value written is the hostname, not the fqdn. So the elected master will always be foo though the masters have different domain names : domain1.tld domain2.tld.

Is there a way to define another value for the lock, let's say the fqdn of the host instead of its hostname ? Is there any other workaround such as --hostname-override option ? Otherwise do you think that'd be wise to create a github issue ?

Thank you ! Smana

-- Smana
kubernetes

0 Answers