dragonflydb / dragonfly-operator

A Kubernetes operator to install and manage Dragonfly instances.
https://www.dragonflydb.io/docs/managing-dragonfly/operator/installation
Apache License 2.0
132 stars 28 forks source link

Move to cluster IP service #84

Closed ashotland closed 1 year ago

ashotland commented 1 year ago

Following https://discord.com/channels/981533931486724126/983406926782160896/threads/1144929396298362900

Headless service seems like a bad choice, it maps to the pod ip which keep changing and makes failover subject to dns cache delay.

We should switch so service IP which is static. Our service matcher on the role label will make it hit the master pod.

@Pothulapati, @Abhra303 WDYT?

eidam commented 1 year ago

IMO as long as there is no scenario when the master becomes a replica without dropping current connections, I believe ClusterIP service is the best option.

ksingh-scogo commented 1 year ago

+1

I have tested both headless and ClusterIP service and i found that in case of failover ClusterIP service responds almost instantly compared to headless. So keeping it as default does make sense.

Thanks @eidam for helping troubleshoot this.

Abhra303 commented 1 year ago

I feel the same as @eidam has said. ClusterIP svc is a better option and also easier for end users.