mysql-operator icon indicating copy to clipboard operation
mysql-operator copied to clipboard

Is it possible to configure the name of headless service mysql?

Open weistonedawei opened this issue 5 years ago • 5 comments

Facing an issue with install another chart into cluster. That chart also installs a headless svc mysql, which conflicts with mysql service installed by mysql operator.

weistonedawei avatar May 13 '20 14:05 weistonedawei

Hi @weistonedawei,

Now it is not possible, but this will be a nice feature. We can add a command-line argument to the operator to set the service name this is the simplest solution or we can add a headless service per cluster. If you would like to open a PR with this feature I will be glad to review and merge it.

Thank you!

AMecea avatar May 30 '20 12:05 AMecea

headless service name is generated from cluster-name just like Sprintf("%s-mysql", clustername) ?

jianhaiqing avatar Jul 14 '20 23:07 jianhaiqing

No, the headless service is hardcoded to mysql in order to have the hostname for each node that follows <cluster-name>-mysql-<index>.mysql.<namespace> pattern, and to keep it short.

AMecea avatar Jul 15 '20 07:07 AMecea

I think it would be better if it's generated by cluster-name, then more than one mysql clusters can be run in one namespace. As far as I know, the length of report_host like "-mysql-.mysql." should be less than 62(or so). It's not that easy to reach the limit; refer to https://github.com/siddontang/go-mysql/issues/388

jianhaiqing avatar Jul 15 '20 09:07 jianhaiqing

@AMecea Can I submit a PR to either remove it or make its name configurable through cluster spec (backwards compatible)? I was planning to run multiple clusters in the same namespace.

jgillich avatar Jan 01 '22 12:01 jgillich