liuruiyiyang commented on a change in pull request #42:
URL: https://github.com/apache/rocketmq-operator/pull/42#discussion_r482748427



##########
File path: example/rocketmq_v1alpha1_broker_cr.yaml
##########
@@ -27,6 +27,10 @@ spec:
   replicationMode: ASYNC
   # replicaPerGroup is the number of each broker cluster
   replicaPerGroup: 1
+  # nodeAffinityKey|nodeAffinityKey|nodeAffinityValues used to schedule 
specified nodes

Review comment:
       How should the users write the CR config yaml if they do not need 
NodeAffinity ?  

##########
File path: pkg/controller/broker/broker_controller.go
##########
@@ -380,6 +380,23 @@ func (r *ReconcileBroker) getBrokerStatefulSet(broker 
*rocketmqv1alpha1.Broker,
                statefulSetName = broker.Name + "-" + 
strconv.Itoa(brokerGroupIndex) + "-replica-" + strconv.Itoa(replicaIndex)
        }
 
+       var affinity corev1.Affinity
+       if broker.Spec.NodeAffinityKey != "" && 
broker.Spec.NodeAffinityOperator != "" && broker.Spec.NodeAffinityValues != nil 
{

Review comment:
       Have you tried if the user do not config Affinity and what happens when 
affinity is nil ?




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to