@@ -5820,6 +5820,189 @@ spec:
58205820                        type: object
58215821                      type: array
58225822                      x-kubernetes-list-type: atomic
5823+                     topologySpreadConstraints:
5824+                       description: |-
5825+                         TopologySpreadConstraints describes how a group of pods ought to spread across topology
5826+                         domains. Scheduler will schedule pods in a way which abides by the constraints.
5827+                         All topologySpreadConstraints are ANDed.
5828+                       items:
5829+                         description: TopologySpreadConstraint specifies how to spread
5830+                           matching pods among the given topology.
5831+                         properties:
5832+                           labelSelector:
5833+                             description: |-
5834+                               LabelSelector is used to find matching pods.
5835+                               Pods that match this label selector are counted to determine the number of pods
5836+                               in their corresponding topology domain.
5837+                             properties:
5838+                               matchExpressions:
5839+                                 description: matchExpressions is a list of label selector
5840+                                   requirements. The requirements are ANDed.
5841+                                 items:
5842+                                   description: |-
5843+                                     A label selector requirement is a selector that contains values, a key, and an operator that
5844+                                     relates the key and values.
5845+                                   properties:
5846+                                     key:
5847+                                       description: key is the label key that the selector
5848+                                         applies to.
5849+                                       type: string
5850+                                     operator:
5851+                                       description: |-
5852+                                         operator represents a key's relationship to a set of values.
5853+                                         Valid operators are In, NotIn, Exists and DoesNotExist.
5854+                                       type: string
5855+                                     values:
5856+                                       description: |-
5857+                                         values is an array of string values. If the operator is In or NotIn,
5858+                                         the values array must be non-empty. If the operator is Exists or DoesNotExist,
5859+                                         the values array must be empty. This array is replaced during a strategic
5860+                                         merge patch.
5861+                                       items:
5862+                                         type: string
5863+                                       type: array
5864+                                       x-kubernetes-list-type: atomic
5865+                                   required:
5866+                                   - key
5867+                                   - operator
5868+                                   type: object
5869+                                 type: array
5870+                                 x-kubernetes-list-type: atomic
5871+                               matchLabels:
5872+                                 additionalProperties:
5873+                                   type: string
5874+                                 description: |-
5875+                                   matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels
5876+                                   map is equivalent to an element of matchExpressions, whose key field is "key", the
5877+                                   operator is "In", and the values array contains only "value". The requirements are ANDed.
5878+                                 type: object
5879+                             type: object
5880+                             x-kubernetes-map-type: atomic
5881+                           matchLabelKeys:
5882+                             description: |-
5883+                               MatchLabelKeys is a set of pod label keys to select the pods over which
5884+                               spreading will be calculated. The keys are used to lookup values from the
5885+                               incoming pod labels, those key-value labels are ANDed with labelSelector
5886+                               to select the group of existing pods over which spreading will be calculated
5887+                               for the incoming pod. The same key is forbidden to exist in both MatchLabelKeys and LabelSelector.
5888+                               MatchLabelKeys cannot be set when LabelSelector isn't set.
5889+                               Keys that don't exist in the incoming pod labels will
5890+                               be ignored. A null or empty list means only match against labelSelector.
5891+ 
5892+                               This is a beta field and requires the MatchLabelKeysInPodTopologySpread feature gate to be enabled (enabled by default).
5893+                             items:
5894+                               type: string
5895+                             type: array
5896+                             x-kubernetes-list-type: atomic
5897+                           maxSkew:
5898+                             description: |-
5899+                               MaxSkew describes the degree to which pods may be unevenly distributed.
5900+                               When `whenUnsatisfiable=DoNotSchedule`, it is the maximum permitted difference
5901+                               between the number of matching pods in the target topology and the global minimum.
5902+                               The global minimum is the minimum number of matching pods in an eligible domain
5903+                               or zero if the number of eligible domains is less than MinDomains.
5904+                               For example, in a 3-zone cluster, MaxSkew is set to 1, and pods with the same
5905+                               labelSelector spread as 2/2/1:
5906+                               In this case, the global minimum is 1.
5907+                               | zone1 | zone2 | zone3 |
5908+                               |  P P  |  P P  |   P   |
5909+                               - if MaxSkew is 1, incoming pod can only be scheduled to zone3 to become 2/2/2;
5910+                               scheduling it onto zone1(zone2) would make the ActualSkew(3-1) on zone1(zone2)
5911+                               violate MaxSkew(1).
5912+                               - if MaxSkew is 2, incoming pod can be scheduled onto any zone.
5913+                               When `whenUnsatisfiable=ScheduleAnyway`, it is used to give higher precedence
5914+                               to topologies that satisfy it.
5915+                               It's a required field. Default value is 1 and 0 is not allowed.
5916+                             format: int32
5917+                             type: integer
5918+                           minDomains:
5919+                             description: |-
5920+                               MinDomains indicates a minimum number of eligible domains.
5921+                               When the number of eligible domains with matching topology keys is less than minDomains,
5922+                               Pod Topology Spread treats "global minimum" as 0, and then the calculation of Skew is performed.
5923+                               And when the number of eligible domains with matching topology keys equals or greater than minDomains,
5924+                               this value has no effect on scheduling.
5925+                               As a result, when the number of eligible domains is less than minDomains,
5926+                               scheduler won't schedule more than maxSkew Pods to those domains.
5927+                               If value is nil, the constraint behaves as if MinDomains is equal to 1.
5928+                               Valid values are integers greater than 0.
5929+                               When value is not nil, WhenUnsatisfiable must be DoNotSchedule.
5930+ 
5931+                               For example, in a 3-zone cluster, MaxSkew is set to 2, MinDomains is set to 5 and pods with the same
5932+                               labelSelector spread as 2/2/2:
5933+                               | zone1 | zone2 | zone3 |
5934+                               |  P P  |  P P  |  P P  |
5935+                               The number of domains is less than 5(MinDomains), so "global minimum" is treated as 0.
5936+                               In this situation, new pod with the same labelSelector cannot be scheduled,
5937+                               because computed skew will be 3(3 - 0) if new Pod is scheduled to any of the three zones,
5938+                               it will violate MaxSkew.
5939+                             format: int32
5940+                             type: integer
5941+                           nodeAffinityPolicy:
5942+                             description: |-
5943+                               NodeAffinityPolicy indicates how we will treat Pod's nodeAffinity/nodeSelector
5944+                               when calculating pod topology spread skew. Options are:
5945+                               - Honor: only nodes matching nodeAffinity/nodeSelector are included in the calculations.
5946+                               - Ignore: nodeAffinity/nodeSelector are ignored. All nodes are included in the calculations.
5947+ 
5948+                               If this value is nil, the behavior is equivalent to the Honor policy.
5949+                               This is a beta-level feature default enabled by the NodeInclusionPolicyInPodTopologySpread feature flag.
5950+                             type: string
5951+                           nodeTaintsPolicy:
5952+                             description: |-
5953+                               NodeTaintsPolicy indicates how we will treat node taints when calculating
5954+                               pod topology spread skew. Options are:
5955+                               - Honor: nodes without taints, along with tainted nodes for which the incoming pod
5956+                               has a toleration, are included.
5957+                               - Ignore: node taints are ignored. All nodes are included.
5958+ 
5959+                               If this value is nil, the behavior is equivalent to the Ignore policy.
5960+                               This is a beta-level feature default enabled by the NodeInclusionPolicyInPodTopologySpread feature flag.
5961+                             type: string
5962+                           topologyKey:
5963+                             description: |-
5964+                               TopologyKey is the key of node labels. Nodes that have a label with this key
5965+                               and identical values are considered to be in the same topology.
5966+                               We consider each <key, value> as a "bucket", and try to put balanced number
5967+                               of pods into each bucket.
5968+                               We define a domain as a particular instance of a topology.
5969+                               Also, we define an eligible domain as a domain whose nodes meet the requirements of
5970+                               nodeAffinityPolicy and nodeTaintsPolicy.
5971+                               e.g. If TopologyKey is "kubernetes.io/hostname", each Node is a domain of that topology.
5972+                               And, if TopologyKey is "topology.kubernetes.io/zone", each zone is a domain of that topology.
5973+                               It's a required field.
5974+                             type: string
5975+                           whenUnsatisfiable:
5976+                             description: |-
5977+                               WhenUnsatisfiable indicates how to deal with a pod if it doesn't satisfy
5978+                               the spread constraint.
5979+                               - DoNotSchedule (default) tells the scheduler not to schedule it.
5980+                               - ScheduleAnyway tells the scheduler to schedule the pod in any location,
5981+                                 but giving higher precedence to topologies that would help reduce the
5982+                                 skew.
5983+                               A constraint is considered "Unsatisfiable" for an incoming pod
5984+                               if and only if every possible node assignment for that pod would violate
5985+                               "MaxSkew" on some topology.
5986+                               For example, in a 3-zone cluster, MaxSkew is set to 1, and pods with the same
5987+                               labelSelector spread as 3/1/1:
5988+                               | zone1 | zone2 | zone3 |
5989+                               | P P P |   P   |   P   |
5990+                               If WhenUnsatisfiable is set to DoNotSchedule, incoming pod can only be scheduled
5991+                               to zone2(zone3) to become 3/2/1(3/1/2) as ActualSkew(2-1) on zone2(zone3) satisfies
5992+                               MaxSkew(1). In other words, the cluster can still be imbalanced, but scheduler
5993+                               won't make it *more* imbalanced.
5994+                               It's a required field.
5995+                             type: string
5996+                         required:
5997+                         - maxSkew
5998+                         - topologyKey
5999+                         - whenUnsatisfiable
6000+                         type: object
6001+                       type: array
6002+                       x-kubernetes-list-map-keys:
6003+                       - topologyKey
6004+                       - whenUnsatisfiable
6005+                       x-kubernetes-list-type: map
58236006                    updateStrategy:
58246007                      description: The deployment strategy to use to replace existing
58256008                        pods with new ones.
0 commit comments