# Ensuring High Availability for Dragonfly in Kubernetes

**URL:** <https://dragonfly.discourse.group/t/ensuring-high-availability-for-dragonfly-in-kubernetes/202>\
**Category:** General\
**Created:** [August 23, 2024, 9:39am UTC](https://dragonfly.discourse.group/t/ensuring-high-availability-for-dragonfly-in-kubernetes/202 "2024-08-23T09:39:04Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![nasil](https://avatars.discourse-cdn.com/v4/letter/n/ed8c4c/32.png) [@nasil](https://dragonfly.discourse.group/u/nasil)\
**Post date:** [August 23, 2024, 9:39am UTC](https://dragonfly.discourse.group/t/ensuring-high-availability-for-dragonfly-in-kubernetes/202/1 "2024-08-23T09:39:04Z")

</div>

I’m setting up Dragonfly in Kubernetes for high availability in a production environment. My current plan involves two EC2 nodes across different AZs, with one master and three replicas (one replica on the same node as the master, and two replicas on the other node). However, the service endpoint only shows the master pod, and the replicas aren’t included.

- Why is only one master used?
- Can Dragonfly support multiple masters?
- Is it effective to create separate services for read-only replicas and writes?

Please advise on a robust architecture for Dragonfly in production without a Single Point of Failure (SPOF).

---

<div class="post-metadata">

**Author:** ![abhradeep](https://avatars.discourse-cdn.com/v4/letter/a/bc79bd/32.png) [@abhradeep](https://dragonfly.discourse.group/u/abhradeep)\
**Post date:** [August 23, 2024, 10:22am UTC](https://dragonfly.discourse.group/t/ensuring-high-availability-for-dragonfly-in-kubernetes/202/2 "2024-08-23T10:22:20Z")

</div>

Hi Nasil, Dragonfly doesn’t support multiple masters and hence operator provides service endpoint for master only (Operator doesn’t support cluster yet). There is already a ticket to support service endpoints for read-only replicas [Add a load balanced service readonly service over replicas · Issue #142 · dragonflydb/dragonfly-operator · GitHub](https://github.com/dragonflydb/dragonfly-operator/issues/142). Feel free to open a PR!

The operator will failover to one of the replicas in case the master is down. So you can deploy replicas along with the master to get high availability.
