Percona Operator - Adding external DNS entries for each PXC node

Hi,

I’m using percona operator to bring up 3 nodes PXC Mysql DB, and I’m setting expose to “true” to expose the IP of each node via Metallb Loadbalancer. I need this each node IP to get added to my powerDNS for which I need to add the annotation “external-dns.alpha.kubernetes.io/hostname=” but not sure how to add it to the pxc definition (cr.yaml). In the cr.yaml, we can give only one entry and not sure how to replicate it for all pods. Any help would be really appreciable.

1 Like

Hello @Arun_Viswanath ,

good use case! We do not support this for now.
I will discuss this with the team.

One question: why do you want to expose PXC nodes separately vs relying on existing proxy - HAProxy or ProxySQL?
There are two cases I can think of right now:

  1. Async replication between two clusters where you need a node per service.
  2. The case where you use your own proxy for MySQL and do not want to use the one provided by the Operator.
1 Like

@spronin. Thanks for your response. I believe it is one Good to have feature.
We are using a 3rd party application and that application expects IPs of the individual nodes of MySQL rather that the cluster IP. As per their requirement, we need to configure 3 Node IPs.

1 Like

@spronin. I’m planning to achieve my requirement by either patching individual pxc service or by adding “kubectl annotate”, but both of these commands are not updating the service object. Is it a know fact ?

kubectl annotate service “external-dns.alpha.kubernetes.io/hostname=.” -n mynamespace

1 Like

@Arun_Viswanath the problem here is that Operator controls services created for the database. Once you add the annotation to it, it is going to roll back all the changes to “desired” state in a reconcile loop (5 seconds).

kubectl annotate service cluster1-pxc-0 "external-dns.alpha.kubernetes.io/hostname=my.host.com" && kubectl get service cluster1-pxc-0 -o yaml | grep -c external-dns  && sleep 5 && kubectl get service cluster1-pxc-0 -o yaml | grep -c external-dns
service/cluster1-pxc-0 annotated
1
0
1 Like