diff --git a/api/v1beta2/sparkapplication_types.go b/api/v1beta2/sparkapplication_types.go index 4a6f6545b..cf43c7fce 100644 --- a/api/v1beta2/sparkapplication_types.go +++ b/api/v1beta2/sparkapplication_types.go @@ -474,6 +474,9 @@ type SparkPodSpec struct { // Affinity specifies the affinity/anti-affinity settings for the pod. // +optional Affinity *corev1.Affinity `json:"affinity,omitempty"` + // Affinity specifies the affinity/anti-affinity settings for the pod. + // +optional + TopologySpreadConstraint []corev1.TopologySpreadConstraint `json:"topologySpreadConstraints,omitempty"` // Tolerations specifies the tolerations listed in ".spec.tolerations" to be applied to the pod. // +optional Tolerations []corev1.Toleration `json:"tolerations,omitempty"` diff --git a/charts/spark-operator-chart/crds/sparkoperator.k8s.io_scheduledsparkapplications.yaml b/charts/spark-operator-chart/crds/sparkoperator.k8s.io_scheduledsparkapplications.yaml index 0a2d9c7f7..d6b46317d 100644 --- a/charts/spark-operator-chart/crds/sparkoperator.k8s.io_scheduledsparkapplications.yaml +++ b/charts/spark-operator-chart/crds/sparkoperator.k8s.io_scheduledsparkapplications.yaml @@ -183,6 +183,43 @@ spec: driver: description: Driver is the driver specification. properties: + topologySpreadConstraints: + type: object + required: + - maxSkew + - topologyKey + - whenUnsatisfiable + properties: + maxSkew: + type: integer + format: int32 + description: >- + Degree to which pods can be unevenly distributed across topology domains. + topologyKey: + type: string + description: >- + The key of node labels. Nodes that have the same value for this label + belong to the same topology domain. + whenUnsatisfiable: + type: string + enum: [ "DoNotSchedule", "ScheduleAnyway" ] + description: >- + Action when it’s impossible to satisfy the constraint. + labelSelector: + $ref: "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector" + matchLabelKeys: + type: array + items: + type: string + minDomains: + type: integer + format: int32 + nodeAffinityPolicy: + type: string + enum: [ "Honor", "Ignore" ] + nodeTaintsPolicy: + type: string + enum: [ "Honor", "Ignore" ] affinity: description: Affinity specifies the affinity/anti-affinity settings for the pod. @@ -5313,6 +5350,40 @@ spec: executor: description: Executor is the executor specification. properties: + topologySpreadConstraints: + type: object + required: + - maxSkew + - topologyKey + - whenUnsatisfiable + properties: + maxSkew: + type: integer + format: int32 + description: >- + Degree to which pods can be unevenly distributed across topology domains. + topologyKey: + type: string + description: >- + The key of node labels. Nodes that have the same value for this label + belong to the same topology domain. + whenUnsatisfiable: + type: string + enum: [ "DoNotSchedule", "ScheduleAnyway" ] + description: >- + Action when it’s impossible to satisfy the constraint. + labelSelector: + $ref: "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector" + matchLabelKeys: + type: array + items: + type: string + minDomains: + type: integer + format: int32 + nodeAffinityPolicy: + type: string + enum: [ "Honor", "Ignore" ] affinity: description: Affinity specifies the affinity/anti-affinity settings for the pod. diff --git a/charts/spark-operator-chart/crds/sparkoperator.k8s.io_sparkapplications.yaml b/charts/spark-operator-chart/crds/sparkoperator.k8s.io_sparkapplications.yaml index c3d4c59ec..b3c0b88b6 100644 --- a/charts/spark-operator-chart/crds/sparkoperator.k8s.io_sparkapplications.yaml +++ b/charts/spark-operator-chart/crds/sparkoperator.k8s.io_sparkapplications.yaml @@ -149,6 +149,43 @@ spec: driver: description: Driver is the driver specification. properties: + topologySpreadConstraints: + type: object + required: + - maxSkew + - topologyKey + - whenUnsatisfiable + properties: + maxSkew: + type: integer + format: int32 + description: >- + Degree to which pods can be unevenly distributed across topology domains. + topologyKey: + type: string + description: >- + The key of node labels. Nodes that have the same value for this label + belong to the same topology domain. + whenUnsatisfiable: + type: string + enum: [ "DoNotSchedule", "ScheduleAnyway" ] + description: >- + Action when it’s impossible to satisfy the constraint. + labelSelector: + $ref: "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector" + matchLabelKeys: + type: array + items: + type: string + minDomains: + type: integer + format: int32 + nodeAffinityPolicy: + type: string + enum: [ "Honor", "Ignore" ] + nodeTaintsPolicy: + type: string + enum: [ "Honor", "Ignore" ] affinity: description: Affinity specifies the affinity/anti-affinity settings for the pod. @@ -5255,6 +5292,43 @@ spec: executor: description: Executor is the executor specification. properties: + topologySpreadConstraints: + type: object + required: + - maxSkew + - topologyKey + - whenUnsatisfiable + properties: + maxSkew: + type: integer + format: int32 + description: >- + Degree to which pods can be unevenly distributed across topology domains. + topologyKey: + type: string + description: >- + The key of node labels. Nodes that have the same value for this label + belong to the same topology domain. + whenUnsatisfiable: + type: string + enum: [ "DoNotSchedule", "ScheduleAnyway" ] + description: >- + Action when it’s impossible to satisfy the constraint. + labelSelector: + $ref: "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector" + matchLabelKeys: + type: array + items: + type: string + minDomains: + type: integer + format: int32 + nodeAffinityPolicy: + type: string + enum: [ "Honor", "Ignore" ] + nodeTaintsPolicy: + type: string + enum: [ "Honor", "Ignore" ] affinity: description: Affinity specifies the affinity/anti-affinity settings for the pod. diff --git a/docs/api-docs.md b/docs/api-docs.md index 861c507cf..c9ef015a5 100644 --- a/docs/api-docs.md +++ b/docs/api-docs.md @@ -3149,6 +3149,20 @@ Kubernetes core/v1.Affinity
topologySpreadConstraintsTopologySpreadConstraint specifies how to spread matching pods among the given topology.
+tolerations