Specify a port for NodePort PXC Node Expose Spec


I have setup 2 Percona MySQL clusters using the PXC cluster operator for kubernetes and aiming an async cross site replication.

    1. Exposed the PXC nodes of source cluster via NodePort.
    1. Configured the source cluster nodes name, port in the replica cluster for async replication.

Data is successfully replicated and application is good :slightly_smiling_face:

Is there a way to explicitly specify the nodePort value in the cr.yml ?

something like this

    size: 2
      enabled: true
      nodePort: 33006
      type: NodePort
1 Like

hi @SridharJ ,

We do not have such a possibility now. Could you please describe in more detail why it is important for you.


When the PXC source pod restart ( due to liveness failures or node maintenance) , NodePort expose assigns a random port. There is worst case scenario where all the PXC source cluster pods restart ( kube cluster maintenance ) and all of them get a random NodePort assigned when they come up. This breaks the replication on the PXC replication pod since the configured PXC source nodes port has changed.

It would be nice to have if the NodePort explicitly specified such that replica cluster’s config need not be changed.

1 Like

Looks like a valid use case, thanks for sharing @SridharJ .

Can you as a workaround use other Service Type (like LoadBalancer)?

1 Like

Ours is a custom kube cluster build and doesn’t have any cloud provider to assign an external IP.
We right now consider the option of NodePort for this cross cluster use case.

1 Like