Skip to content

[Feature]: Add topologySpreadConstraints support #2908

@ptrvsrg

Description

@ptrvsrg

Requirement

We need to support Kubernetes topologySpreadConstraints in the Jaeger Operator to enable better distribution of Jaeger components pods across topology domains (nodes, zones, regions). This is critical for:

  • High availability deployments
  • Better resource utilization across zones
  • Meeting organizational infrastructure requirements for pod distribution

Problem

Currently, the Jaeger Operator CRD for components supports affinity and tolerations, but does not expose topologySpreadConstraints field. This prevents users from defining topology spread policies for ensuring pods are distributed evenly across different topology domains.

Proposal

Add topologySpreadConstraints field to JaegerCommonSpec structure

The field should:

  • Be of type []corev1.TopologySpreadConstraint (matching standard Kubernetes API)
  • Be optional (nil by default)
  • Be passed directly to the generated Deployment/StatefulSet/Job specs for Jaeger components

Example Usage

apiVersion: jaegertracing.io/v1
kind: Jaeger
metadata:
name: my-jaeger
spec:
  query:
    topologySpreadConstraints:
      - labelSelector:
          matchLabels:
            app.kubernetes.io/name: jaeger-query
        maxSkew: 1
        topologyKey: topology.kubernetes.io/zone
        whenUnsatisfiable: DoNotSchedule

Open questions

  • Are there any backward compatibility concerns with adding this optional field?

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