Skip to content

Service for read-write instance #3722

Open
@Agalin

Description

@Agalin

Overview

There should be one more service created for a cluster - one pointing only to a writeable primary. It should not point to any pod if cluster is currently in the standby mode.

Use Case

I have a service mesh (linkerd) configured in a way that makes it possible to replicate (mirror) services cross-cluster and use them as local. It's an alternative to a loadbalancer or nodeport. But in case of a primary cluster failure failover is still a multistep process.

  • Configure one of the standby clusters to be a new primary (disable standby).
  • Update all apps to use a mirrored service of the new primary.
  • If direct replication is used: Update all other clusters to use a mirrored service of the new primary.

Linkerd (and probably other services) makes it possible to automatically failover a service in case of the main one being unreachable. It can route all traffic to the new mirrored service. But it works in such a way that traffic is split equally between all secondary services. Which means with current setup you can only put a single failover cluster in the secondary list. Otherwise when primary fails traffic gets split equally to all clusters even if nodes are read-only.

With a service pointing only to a writeable node failover would look like this:

  • Configure one of the standby clusters to be a new primary (disable standby).
  • Linkerd automatically updates routing rules to point to the new primary cluster after detecting an available endpoint.
  • All apps are transparently redirected to the new primary.
  • All other clusters are transparently redirected to the new primary.

Desired Behavior

To the list of services managed by the operator:

  • db-ha
  • db-ha-config
  • db-pods
  • db-primary
  • db-replicas

add a new one (db-ha-rw, db-primary-writeable, whatever) - or even just attach a label to the current writeable primary that it's writeable - then user can create such a service manually.

Environment

Tell us about your environment:

Please provide the following details:

  • Platform: Kubernetes

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions