Merge pull request #10736 from pkalever/clusterName-metadata

CSI: provide a way to supply `--setmetadata` and `--clustername` to the csi driver
This commit is contained in:
Travis Nielsen
2022-08-23 13:06:27 -06:00
committed by GitHub
9 changed files with 49 additions and 0 deletions
@@ -73,6 +73,8 @@ The following tables lists the configurable parameters of the rook-operator char
| `csi.rbdFSGroupPolicy` | Policy for modifying a volume's ownership or permissions when the RBD PVC is being mounted | `ReadWriteOnceWithFSType` |
| `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` |
@@ -17,6 +17,7 @@ data:
CSI_ENABLE_ENCRYPTION: {{ .Values.csi.enableCSIEncryption | quote }}
CSI_ENABLE_OMAP_GENERATOR: {{ .Values.csi.enableOMAPGenerator | quote }}
CSI_ENABLE_HOST_NETWORK: {{ .Values.csi.enableCSIHostNetwork | quote }}
CSI_ENABLE_METADATA: {{ .Values.csi.enableMetadata | quote }}
{{- if .Values.csi.pluginPriorityClassName }}
CSI_PLUGIN_PRIORITY_CLASSNAME: {{ .Values.csi.pluginPriorityClassName | quote }}
{{- end }}
@@ -177,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 }}
+8
View File
@@ -98,9 +98,17 @@ csi:
# sidecar with CSI provisioner pod, to enable set it to true.
enableOMAPGenerator: false
# (Optional) set to true to enable adding volume metadata on the CephFS subvolumes and RBD images.
# Not all users might be interested in getting volume/snapshot details as metadata on CephFS subvolume and RBD images.
# Hence enable metadata is false by default.
enableMetadata: false
# 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
+7
View File
@@ -122,6 +122,13 @@ data:
# Set to true to enable Ceph CSI pvc encryption support.
CSI_ENABLE_ENCRYPTION: "false"
# 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.
+9
View File
@@ -42,6 +42,15 @@ data:
# there is significant drop in read/write performance.
# CSI_ENABLE_HOST_NETWORK: "true"
# Set to true to enable adding volume metadata on the CephFS subvolume and RBD images.
# Not all users might be interested in getting volume/snapshot details as metadata on CephFS subvolume and RBD images.
# 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"
+5
View File
@@ -180,6 +180,10 @@ func (r *ReconcileCSI) setParams(ver *version.Info) error {
CSIParam.EnableCSIEncryption = true
}
if strings.EqualFold(k8sutil.GetValue(r.opConfig.Parameters, "CSI_ENABLE_METADATA", "false"), "true") {
CSIParam.CSIEnableMetadata = true
}
if strings.EqualFold(k8sutil.GetValue(r.opConfig.Parameters, "CSI_CEPHFS_PLUGIN_UPDATE_STRATEGY", rollingUpdate), onDelete) {
CSIParam.CephFSPluginUpdateStrategy = onDelete
} else {
@@ -261,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
}
+2
View File
@@ -57,7 +57,9 @@ type Param struct {
ProvisionerPriorityClassName string
VolumeReplicationImage string
CSIAddonsImage string
CSIClusterName string
GRPCTimeout time.Duration
CSIEnableMetadata bool
EnablePluginSelinuxHostMount bool
EnableCSIHostNetwork bool
EnableOMAPGenerator bool
@@ -114,6 +114,12 @@ spec:
- "--forcecephkernelclient={{ .ForceCephFSKernelClient }}"
- "--metricspath=/metrics"
- "--enablegrpcmetrics={{ .EnableCSIGRPCMetrics }}"
{{ if .CSIEnableMetadata }}
- "--setmetadata={{ .CSIEnableMetadata }}"
{{ end }}
{{ if .CSIClusterName }}
- "--clustername={{ .CSIClusterName }}"
{{ end }}
env:
- name: POD_IP
valueFrom:
@@ -199,6 +199,12 @@ spec:
{{ if .EnableCSIAddonsSideCar }}
- "--csi-addons-endpoint=$(CSIADDONS_ENDPOINT)"
{{ end }}
{{ if .CSIEnableMetadata }}
- "--setmetadata={{ .CSIEnableMetadata }}"
{{ end }}
{{ if .CSIClusterName }}
- "--clustername={{ .CSIClusterName }}"
{{ end }}
env:
- name: POD_IP
valueFrom: