Skip to content

[Epic] Topology and affinity settings for applications in Cozystack #1949

@lllamnyp

Description

@lllamnyp

Summary

As a Cozystack user, I want to configure topology and affinity settings for managed applications, so that I can control how replicas are scheduled across availability zones and nodes.

Problem

Currently, managed applications (PostgreSQL, Redis, Kubernetes clusters, etc.) rely on the default kube-scheduler configuration for pod placement. Users have no way to explicitly control:

  • Whether replicas should be spread across availability zones (for HA)
  • Whether replicas should be co-located in a single zone (for lower latency)
  • Node affinity preferences based on labels

Proposed Solution

Add optional topology or affinity configuration to all managed application specs, allowing users to specify:

  • Topology spread constraints - e.g., spread across zones, or keep in single zone
  • Node affinity - e.g., prefer nodes with specific labels
  • Pod anti-affinity - e.g., avoid co-locating replicas on the same node

Example configuration:

spec:
  topologyPolicy: spreadAcrossZones  # or: singleZone, spreadAcrossNodes
  nodeSelector:
    disktype: ssd

Applications to Update

  • PostgreSQL
  • Redis
  • MongoDB
  • Kubernetes (worker nodes)
  • Virtual Machines
  • Other stateful applications

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions