rbd: add capability to automatically enable read affinity

This commit makes use of crush location labels from node
labels to supply `crush_location` and `read_from_replica=localize`
options during rbd map cmd. Using these options, ceph
will be able to redirect reads to the closest OSD,
improving performance.

Signed-off-by: Rakshith R <rar@redhat.com>
This commit is contained in:
Rakshith R
2023-02-02 15:16:37 +05:30
committed by mergify[bot]
parent 6e6cddb096
commit 95682522ee
7 changed files with 401 additions and 21 deletions

View File

@ -79,8 +79,15 @@ func init() {
&conf.DomainLabels,
"domainlabels",
"",
"list of kubernetes node labels, that determines the topology"+
"list of Kubernetes node labels, that determines the topology"+
" domain the node belongs to, separated by ','")
flag.BoolVar(&conf.EnableReadAffinity, "enable-read-affinity", false, "enable read affinity")
flag.StringVar(
&conf.CrushLocationLabels,
"crush-location-labels",
"",
"list of Kubernetes node labels, that determines the"+
" CRUSH location the node belongs to, separated by ','")
// cephfs related flags
flag.BoolVar(