Uploaded image for project: 'OpenShift Request For Enhancement'
  1. OpenShift Request For Enhancement
  2. RFE-7840

Request to change PodTopologySpread defaultConstraints

XMLWordPrintable

    • Icon: Feature Request Feature Request
    • Resolution: Unresolved
    • Icon: Major Major
    • None
    • openshift-4.16
    • Node
    • None
    • None
    • Product / Portfolio Work
    • None
    • False
    • Hide

      None

      Show
      None
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • None

       [1] Proposed title of this feature request
      -> Request to change PodTopologySpread defaultConstraints.

      [2] What is the nature and description of the request?
      -> 

      Customer do maintenance on one rack at a time so we need to ensure that Pods are spread across Racks.

      https://kubernetes.io/docs/concepts/scheduling-eviction/topology-spread-constraints/#internal-default-constraints  says:
      If you don't configure any cluster-level default constraints for pod topology spreading, then kube-scheduler acts as if you specified the following default topology constraints:

      defaultConstraints:
        - maxSkew: 3
          topologyKey: "kubernetes.io/hostname"
          whenUnsatisfiable: ScheduleAnyway
        - maxSkew: 5
          topologyKey: "topology.kubernetes.io/zone"
          whenUnsatisfiable: ScheduleAnyway

      This means that Pods are spread across both hostnames and zones, but the default maxSkew values are really high so Deployment/StatefulSets with 3 replicas (as is common) can still be scheduled on the same Node or rack.

      To resolve this using vanilla Kubernetes we could create a similar config with maxSkew=0:

       

      apiVersion: kubescheduler.config.k8s.io/v1
      kind: KubeSchedulerConfiguration
      ...
      profiles:
        - schedulerName: default-scheduler
          pluginConfig:
            - name: PodTopologySpread
              args:
                defaultConstraints: []
                defaultConstraints:
                  - maxSkew: 0
                    topologyKey: "kubernetes.io/hostname"
                    whenUnsatisfiable: ScheduleAnyway
                  - maxSkew: 0
                    topologyKey: "topology.kubernetes.io/zone"
                    whenUnsatisfiable: ScheduleAnyway
       
      

      How would we do the same with OpenShift?

       [3]Why does the customer need this? (List the business requirements here)
      -> 

      It is important that all of the Pod replicas of a Deployment/StatefulSet run on different Nodes so that there is no service outage with Node maintenance.
      We do maintenance on one rack at a time so we need to ensure that Pods are spread across Racks.

       

      List any affected packages or components.
      -> 

              gausingh@redhat.com Gaurav Singh
              rhn-support-hthakare Harshal Thakare
              None
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                None
                None