forked from rook/rook
The osd prepare job detects the failure domain for the OSD by querying the node topology labels. This topology is then assigned to the OSD daemon in the CRUSH map. Previously, the affinity was required to be set in the cluster CR, but it was very difficult to get right. Now the operator will enforce the correct topology label on the OSD daemon nodeAffinity by setting the label of the lowest topology in the hierarcy. For example, if there are region, zone, and rack labels, the rack label would be used to set the node affinity for the OSD daemon. If an OSD prepare job is run in rack1, the corresponding OSD daemon will have node affinity to rack1 to ensure the same topology. Previously, the OSD could have ended up in rack2 unless the storageClassDeviceSet placement was very carefully crafted. Signed-off-by: Travis Nielsen <tnielsen@redhat.com>