deploy: support for read affinity options per cluster

Implemented the capability to include read affinity options
for individual clusters within the ceph-csi-config ConfigMap.
This allows users to configure the crush location for each
cluster separately. The read affinity options specified in
the ConfigMap will supersede those provided via command line arguments.

Signed-off-by: Praveen M <m.praveen@ibm.com>
This commit is contained in:
Praveen M
2023-10-30 13:53:12 +05:30
committed by mergify[bot]
parent 93f2ed681f
commit c4e373c72f
12 changed files with 338 additions and 99 deletions

View File

@ -23,20 +23,15 @@ import (
)
// GetCrushLocationMap returns the crush location map, determined from
// the crush location labels and their values from the CO system.
// the crush location labels and their values from the node labels passed in arg.
// Expects crushLocationLabels in arg to be in the format "[prefix/]<name>,[prefix/]<name>,...",.
// Returns map of crush location types with its array of associated values.
func GetCrushLocationMap(crushLocationLabels, nodeName string) (map[string]string, error) {
func GetCrushLocationMap(crushLocationLabels string, nodeLabels map[string]string) map[string]string {
if crushLocationLabels == "" {
return nil, nil
return nil
}
nodeLabels, err := k8sGetNodeLabels(nodeName)
if err != nil {
return nil, err
}
return getCrushLocationMap(crushLocationLabels, nodeLabels), nil
return getCrushLocationMap(crushLocationLabels, nodeLabels)
}
// getCrushLocationMap returns the crush location map, determined from