PXC cluster for mysql is not choosing the secondary as primary

Hello ,

I have percona cluster setup with 3 nodes. When i check the node wsrep_cluster_node_status=primary. The cluster is hosted in K8s.
Now wsrep_node_name=pxc-0 only .
So when i try to mimic the situation where this pod 0 goes down and pod 1 and pod 2 running the traffic should be handled by either of them post promoting either of them as primary . However the connections get lost and wait for pod 0 to be up and till then the connections are not getting connected to DB. I have ha proxy which also gets 3 replica count , when pod 0 goes down even proxy 0 goes down with error that the pod 0 is not available only 2 nodes available .

can someone help how to make sure this traffic gets routed across other nodes when one goes down

Hello @skybot_win,
Are you using our operator? The Percona operator will automatically handle failover using HAProxy or ProxySQL by correctly configuring the needed K8S services and endpoints. I recommend you try our operator for easier management of your PXC.

Without knowing more of your K8S config/setup, it’s hard to understand what might be going wrong in your environment. It sounds like you’ve got some dependency on your HAProxy pod for node0 pod and you need to remove that.