adfinis / openshift-mariadb-galera

Kubernetes / OpenShift Images for a MariaDB Galera Cluster
GNU General Public License v3.0
37 stars 42 forks source link

Can't work with a custom dns domain #12

Open xiaosuiba opened 7 years ago

xiaosuiba commented 7 years ago

Hi, I was deploying this statefulset on my local kubernetes(v1.5) cluster using the script galera_k8s_v1.5.yml. But the first pod failed to start. After checking the log serveral times I found it stuck at:

+ /usr/bin/peer-finder -on-start=/uisr/share/container-scripts/mysql/configure-galera.sh -service=galera

I was pretty sure the dns is working perfectly, so I checked the source code of peer-finder and did some debugging. Then I found out where the problem is. https://github.com/kubernetes/contrib/blob/master/pets/peer-finder/peer-finder.go#L43

    domain    = flag.String("domain", "cluster.local", "The Cluster Domain which is used by the Cluster.")

peer-finder is asking for a domain flag which could be passed by --domain, or it'll use the default setting cluster.local. In my case, I used a custom dns domain test.local instead of the default one cluster.local. Then peer-finder will compare mysql-0.galera.default.svc.cluster.local with mysql-0.galera.default.svc.test.local and then stuck in a infinite loop. So could anyone add an ENV or something else and pass it to the peer-finder to get it work?

tongpu commented 7 years ago

We'll look into that and make the cluster domain configurable in the container.

eni23 commented 7 years ago

Our peer-finder does not have this implemented yet. We have to compile it again and put it in the image. As i can see this should not cause any issues.

rtprio commented 7 years ago

I'm also having an issue with it getting stuck; I rebuild the container using a newer version of peer-finder and it's also in an infinate loop. However we're not using custom dns.

  2017/09/06 16:52:33 Have not found myself in list yet.
  My Hostname: mariadb-cluster-1.mariadb-cluster.amze-drupal-example-mariadb-cluster.svc.cluster.local
  Hosts in list: a59b90d7.mariadb-cluster.amze-drupal-example-mariadb-cluster.svc.cluster.local
  2017/09/06 16:52:34 Have not found myself in list yet.
  My Hostname: mariadb-cluster-1.mariadb-cluster.amze-drupal-example-mariadb-cluster.svc.cluster.local
  Hosts in list: a59b90d7.mariadb-cluster.amze-drupal-example-mariadb-cluster.svc.cluster.local

and so on.

tongpu commented 7 years ago

@rtprio What you're experiencing seems to be a mismatch between what peer-finder looks for (mariadb-cluster-1) and what the service reports (a59b90d7). This could be different issue related to the service.

metal3d commented 6 years ago

I also have the same output as @rtprio with another service. I really don't understand what I'm doning wrong. The dns is not changed, I'm using the OpenShift one.

That means that peer-finder is broken ? should I try another version, and wich one ?

metal3d commented 6 years ago

@tongpu I tried to use that peer-finder bin: https://github.com/adfinis-sygroup/openshift-mariadb-galera/blob/master/k8s-mariadb-galera-centos/root/usr/bin/peer-finder

And now, the problem disapeared, sorry for my comment, that was the bad repository. I sould create an issue on kubernetes/contrib instead.