You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@uniffle.apache.org by "advancedxy (via GitHub)" <gi...@apache.org> on 2023/02/21 11:01:08 UTC

[GitHub] [incubator-uniffle] advancedxy commented on a diff in pull request #638: feat(operator): support specifying custom tolerations

advancedxy commented on code in PR #638:
URL: https://github.com/apache/incubator-uniffle/pull/638#discussion_r1112898529


##########
deploy/kubernetes/operator/api/uniffle/v1alpha1/remoteshuffleservice_types.go:
##########
@@ -249,6 +253,15 @@ type MainContainer struct {
 	// VolumeMounts indicates describes mountings of volumes within shuffle servers' container.
 	// +optional
 	VolumeMounts []corev1.VolumeMount `json:"volumeMounts,omitempty"`
+
+	// NodeSelector is a selector which must be true for the pod to fit on a node.
+	// Selector which must match a node's labels for the pod to be scheduled on that node.
+	// +optional
+	NodeSelector map[string]string `json:"nodeSelector,omitempty"`
+
+	// Indicates the tolerations the pods under this subset have.
+	// +optional
+	Tolerations []corev1.Toleration `json:"tolerations,omitempty"`

Review Comment:
   It's not necessary to define `NodeSelector` and `Tolerations` in the MainContainer. It's already defined in the `RssPodSpec`



##########
deploy/kubernetes/operator/api/uniffle/v1alpha1/remoteshuffleservice_types.go:
##########
@@ -218,6 +218,10 @@ type RSSPodSpec struct {
 	// Selector which must match a node's labels for the pod to be scheduled on that node.
 	// +optional
 	NodeSelector map[string]string `json:"nodeSelector,omitempty"`
+
+	// Indicates the tolerations the pods under this subset have.
+	// +optional
+	Tolerations []corev1.Toleration `json:"tolerations,omitempty"`

Review Comment:
   cloud you also add affinity settings here?
   
   this pr could be an followup of  https://github.com/apache/incubator-uniffle/issues/545, which mentions to add toleration and affinity settings.



##########
deploy/kubernetes/operator/pkg/controller/sync/coordinator/coordinator.go:
##########
@@ -178,12 +178,7 @@ func GenerateDeploy(rss *unifflev1alpha1.RemoteShuffleService, index int) *appsv
 	podSpec := corev1.PodSpec{
 		HostNetwork:        *rss.Spec.Coordinator.HostNetwork,
 		ServiceAccountName: utils.GenerateCoordinatorName(rss),
-		Tolerations: []corev1.Toleration{
-			{
-				Effect: corev1.TaintEffectNoSchedule,
-				Key:    "node-role.kubernetes.io/master",
-			},
-		},
+		Tolerations:  rss.Spec.Coordinator.Tolerations,

Review Comment:
   if toleration is not specified, please use the default toleration.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@uniffle.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@uniffle.apache.org
For additional commands, e-mail: issues-help@uniffle.apache.org