Skip to content

Add topologySpreadConstraints to the artifactory-ha helm chart #1593

Description

@rkevin-arch

Is this a request for help?:
No


Is this a BUG REPORT or FEATURE REQUEST? (choose one):
Feature Request

It would be nice to support topologySpreadConstraints for the artifactory-ha chart to support spreading Artifactory and nginx pods across multiple nodes / zones. Right now we can technically use podAntiAffinity to force one Artifactory / nginx pod per node, but that's not as flexible as topologySpreadConstraints.

I'm envisioning something along the lines of this in `values.yaml:

artifactory:
  topologySpreadConstraints:
    maxSkew: 1
    whenUnsatisfiable: DoNotSchedule
    topologyKey: kubernetes.io/hostname
nginx:
  topologySpreadConstraints:
    maxSkew: 1
    topologyKey: kubernetes.io/hostname
    whenUnsatisfiable: DoNotSchedule

which gets populated as the following in the primary and member statefulsets:

spec:
  template:
    spec:
      topologySpreadConstraints:
        maxSkew: 1
        topologyKey: kubernetes.io/hostname
        whenUnsatisfiable: DoNotSchedule
        labelSelector:
          matchLabels:
            component: artifactory-ha # or some other label that applies to the primary and all members

and similar for nginx, just with a different labelSelector that matches all nginx pods instead. This guarantees that all Artifactory pods and all nginx pods are spread evenly across all nodes.

Version of Helm and Kubernetes:
Helm 3.8.0, Kubernetes v1.20.11-eks-f17b81

Which chart:
artifactory-ha, although other charts can benefit from this as well

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