Hrm, the svc.namespace resolution _should_ work. Can you test the zk-2.zk-headless record? See the troubleshooting tips on this page for how: https://kubernetes.io/docs/concepts/services-networking/dns-pod-service/
If you can't get those instructions to work we there are some more DNS / networking debugging docs here <https://coreos.com/kubernetes/docs/latest/network-troubleshooting.html>. Aside: We just released a new project called zetcd <https://coreos.com/blog/introducing-zetcd> which makes emulates zookeeper on top of an etcd cluster. This makes it possible to launch an etcd cluster on Kubernetes with the etcd Operator <https://coreos.com/blog/introducing-the-etcd-operator.html> and run zookeeper on top. This is the first release of zetcd though, but mesos and kafka are working against it. Cheers, Brandon On Fri, May 19, 2017 at 6:32 AM <george.pu...@gmail.com> wrote: > Hello everybody, > > I was following the kubernetes tutorial from here > https://kubernetes.io/docs/tutorials/stateful-application/zookeeper/. The > tutorial is great and I was able to run it successfully. > > However, I tried to reproduce the steps of running zookeeper using a > separate namespace. > First, I tried to configure the zoo.cfg like this: > > server.1=zk-0.zk-headless:2888:3888 > server.2=zk-1.zk-headless:2888:3888 > server.3=zk-2.zk-headless:2888:3888 > > This setup didn't work. Only two nodes server.2 and server.3 were forming > a cluster, sometimes also server.1 and server.2 but it was always that one > of the servers didn't join the cluster. > > The configuration that worked for me for zoo.cfg was: > > server.1=zk-0.zk-headless.mynamespace.svc.cluster.local:2888:3888 > server.2=zk-1.zk-headless.mynamespace.svc.cluster.local:2888:3888 > server.3=zk-2.zk-headless.mynamespace.svc.cluster.local:2888:3888 > > With this config all 3 zookeepers were forming a cluster and everything > works fine. > The question is why do I need to specify the FQDN for this example to > work? Even in the first case were I specified statefulset.service, this > name was resolved to only one IP. Are FQDN always > necessary when referencing a pod in a stateful set like in the above > example? > > > I'm running kubernetes 1.6 on AWS with one master and one worked node. > > Thanks, > George > > -- > You received this message because you are subscribed to the Google Groups > "Kubernetes user discussion and Q&A" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to kubernetes-users+unsubscr...@googlegroups.com. > To post to this group, send email to kubernetes-users@googlegroups.com. > Visit this group at https://groups.google.com/group/kubernetes-users. > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "Kubernetes user discussion and Q&A" group. To unsubscribe from this group and stop receiving emails from it, send an email to kubernetes-users+unsubscr...@googlegroups.com. To post to this group, send email to kubernetes-users@googlegroups.com. Visit this group at https://groups.google.com/group/kubernetes-users. For more options, visit https://groups.google.com/d/optout.