csi: provide a way to set --clustername at csi driver

One can now use the operator configmap for CSI_CLUSTER_NAME variable
for setting ClusterName on the RBD images and CephFS subvolume.
This will be useful in cases like for example, when two container orchestrator
clusters (Kubernetes/OCP) are using a single ceph cluster.

Signed-off-by: Prasanna Kumar Kalever <prasanna.kalever@redhat.com>
This commit is contained in:
Prasanna Kumar Kalever
2022-08-23 12:12:02 +05:30
parent b5b8cbf6ae
commit e376c17bfb
9 changed files with 23 additions and 0 deletions
@@ -74,6 +74,7 @@ The following tables lists the configurable parameters of the rook-operator char
| `csi.cephFSFSGroupPolicy` | Policy for modifying a volume's ownership or permissions when the CephFS PVC is being mounted | `ReadWriteOnceWithFSType` |
| `csi.nfsFSGroupPolicy` | Policy for modifying a volume's ownership or permissions when the NFS PVC is being mounted | `ReadWriteOnceWithFSType` |
| `csi.enableMetadata` | Set volume metadata on the CephFS subvolumes and RBD images. | `false` |
| `csi.clusterName` | Cluster name identifier to set as metadata on the CephFS subvolumes and RBD images. | `<none>` |
| `csi.logLevel` | Set logging level for cephCSI containers maintained by the cephCSI. Supported values from 0 to 5. 0 for general useful logs, 5 for trace level verbosity. | `0` |
| `csi.sidecarLogLevel` | Set logging level for cephCSI sidecar containers. Supported values from 0 to 5. 0 for general useful logs (the default), 5 for trace level verbosity. | `0` |
| `csi.grpcTimeoutInSeconds` | Set GRPC timeout for csi containers. | `150` |
@@ -178,6 +178,9 @@ data:
{{- if .Values.csi.sidecarLogLevel }}
CSI_SIDECAR_LOG_LEVEL: {{ .Values.csi.sidecarLogLevel | quote }}
{{- end }}
{{- if .Values.csi.clusterName }}
CSI_CLUSTER_NAME: {{ .Values.csi.clusterName | quote }}
{{- end }}
{{- if .Values.csi.grpcTimeoutInSeconds }}
CSI_GRPC_TIMEOUT_SECONDS: {{ .Values.csi.grpcTimeoutInSeconds | quote }}
{{- end }}
+3
View File
@@ -106,6 +106,9 @@ csi:
# Set replicas for csi provisioner deployment.
provisionerReplicas: 2
# (Optional) cluster name identifier to set as metadata on the CephFS subvolume and RBD images. This will be useful
# in cases like for example, when two container orchestrator clusters (Kubernetes/OCP) are using a single ceph cluster.
# clusterName: "my-prod-cluster"
# Set logging level for cephCSI containers maintained by the cephCSI.
# Supported values from 0 to 5. 0 for general useful logs, 5 for trace level verbosity.
#logLevel: 0
+4
View File
@@ -125,6 +125,10 @@ data:
# set to true to enable adding volume metadata on the CephFS subvolume and RBD images.
# CSI_ENABLE_METADATA: "true"
# cluster name identifier to set as metadata on the CephFS subvolume and RBD images. This will be useful in cases
# like for example, when two container orchestrator clusters (Kubernetes/OCP) are using a single ceph cluster.
# CSI_CLUSTER_NAME: "my-prod-cluster"
# Set to true to enable host networking for CSI CephFS and RBD nodeplugins. This may be necessary
# in some network configurations where the SDN does not provide access to an external cluster or
# there is significant drop in read/write performance.
+4
View File
@@ -47,6 +47,10 @@ data:
# Hence enable metadata is false by default.
# CSI_ENABLE_METADATA: "true"
# cluster name identifier to set as metadata on the CephFS subvolume and RBD images. This will be useful in cases
# like for example, when two container orchestrator clusters (Kubernetes/OCP) are using a single ceph cluster.
# CSI_CLUSTER_NAME: "my-prod-cluster"
# Set logging level for cephCSI containers maintained by the cephCSI.
# Supported values from 0 to 5. 0 for general useful logs, 5 for trace level verbosity.
# CSI_LOG_LEVEL: "0"
+1
View File
@@ -265,6 +265,7 @@ func (r *ReconcileCSI) setParams(ver *version.Info) error {
CSIParam.CSINFSPodLabels = k8sutil.ParseStringToLabels(csiNFSPodLabels)
csiRBDPodLabels := k8sutil.GetValue(r.opConfig.Parameters, "ROOK_CSI_RBD_POD_LABELS", "")
CSIParam.CSIRBDPodLabels = k8sutil.ParseStringToLabels(csiRBDPodLabels)
CSIParam.CSIClusterName = k8sutil.GetValue(r.opConfig.Parameters, "CSI_CLUSTER_NAME", "")
return nil
}
+1
View File
@@ -57,6 +57,7 @@ type Param struct {
ProvisionerPriorityClassName string
VolumeReplicationImage string
CSIAddonsImage string
CSIClusterName string
GRPCTimeout time.Duration
CSIEnableMetadata bool
EnablePluginSelinuxHostMount bool
@@ -117,6 +117,9 @@ spec:
{{ if .CSIEnableMetadata }}
- "--setmetadata={{ .CSIEnableMetadata }}"
{{ end }}
{{ if .CSIClusterName }}
- "--clustername={{ .CSIClusterName }}"
{{ end }}
env:
- name: POD_IP
valueFrom:
@@ -202,6 +202,9 @@ spec:
{{ if .CSIEnableMetadata }}
- "--setmetadata={{ .CSIEnableMetadata }}"
{{ end }}
{{ if .CSIClusterName }}
- "--clustername={{ .CSIClusterName }}"
{{ end }}
env:
- name: POD_IP
valueFrom: