ceph: add option to toggle host networking in csi plugin pods

As host networking is no longer necessary for CSI driver,
it will be disabled by default.
An option CSI_ENABLE_HOST_NETWORK is added to rook-ceph-operator-config
configmap and enableCSIHostNetwork in helm chart values.yaml to
enable/disable host network in CSI plugin pods.

Closes: #7203

Signed-off-by: Rakshith R <rar@redhat.com>
This commit is contained in:
Rakshith R committed 2021-04-20 12:57:09 +05:30
1 parent 48978f9919
commit f5a3f6fa71
9 files changed
+30 -2

No files matched your search

+1
View File
@@ -110,6 +110,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.logLevel` | Set logging level for csi containers. Supported values from 0 to 5. 0 for general useful logs, 5 for trace level verbosity. | `0` |
| `csi.enableGrpcMetrics` | Enable Ceph CSI GRPC Metrics. | `false` |
| `csi.enableCSIHostNetwork` | Enable Host Networking for Ceph CSI nodeplugins. | `false` |
| `csi.provisionerTolerations` | Array of tolerations in YAML format which will be added to CSI provisioner deployment. | <none> |
| `csi.provisionerNodeAffinity` | The node labels for affinity of the CSI provisioner deployment (***) | <none> |
| `csi.pluginTolerations` | Array of tolerations in YAML format which will be added to Ceph CSI plugin DaemonSet | <none> |
@@ -122,6 +122,10 @@ spec:
value: {{ .Values.csi.enableOMAPGenerator | quote }}
- name: CSI_ENABLE_VOLUME_REPLICATION
value: {{ .Values.csi.volumeReplication.enabled | quote }}
{{- if .Values.csi.enableCSIHostNetwork }}
- name: CSI_ENABLE_HOST_NETWORK
value: {{ .Values.csi.enableCSIHostNetwork | quote }}
{{- end }}
{{- if .Values.csi.cephFSPluginUpdateStrategy }}
- name: CSI_CEPHFS_PLUGIN_UPDATE_STRATEGY
value: {{ .Values.csi.cephFSPluginUpdateStrategy | quote }}
+4
View File
@@ -56,6 +56,10 @@ csi:
enableRbdDriver: true
enableCephfsDriver: true
enableGrpcMetrics: false
# 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.
# CSI_ENABLE_HOST_NETWORK: "true"
# set to false to disable deployment of snapshotter container in CephFS provisioner pod.
enableCephfsSnapshotter: true
# set to false to disable deployment of snapshotter container in RBD provisioner pod.
@@ -19,7 +19,7 @@ spec:
{{ end }}
spec:
serviceAccount: rook-csi-cephfs-plugin-sa
hostNetwork: true
hostNetwork: {{ .EnableCSIHostNetwork }}
{{ if .PluginPriorityClassName }}
priorityClassName: {{ .PluginPriorityClassName }}
{{ end }}
@@ -22,7 +22,7 @@ spec:
{{ if .PluginPriorityClassName }}
priorityClassName: {{ .PluginPriorityClassName }}
{{ end }}
hostNetwork: true
hostNetwork: {{ .EnableCSIHostNetwork }}
hostPID: true
# to use e.g. Rook orchestrated cluster, and mons' FQDN is
# resolved through k8s service, set dns policy to cluster first
@@ -105,6 +105,11 @@ data:
ROOK_CSI_ENABLE_RBD: "true"
ROOK_CSI_ENABLE_GRPC_METRICS: "false"
# 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.
# CSI_ENABLE_HOST_NETWORK: "true"
# Set logging level for csi containers.
# Supported values from 0 to 5. 0 for general useful logs, 5 for trace level verbosity.
# CSI_LOG_LEVEL: "0"
@@ -29,6 +29,11 @@ data:
ROOK_CSI_ENABLE_RBD: "true"
ROOK_CSI_ENABLE_GRPC_METRICS: "false"
# 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.
# CSI_ENABLE_HOST_NETWORK: "true"
# Set logging level for csi containers.
# Supported values from 0 to 5. 0 for general useful logs, 5 for trace level verbosity.
# CSI_LOG_LEVEL: "0"
+8
View File
@@ -84,6 +84,14 @@ func SetParams(clientset kubernetes.Interface) error {
return errors.Wrap(err, "unable to parse value for 'ROOK_CSI_ENABLE_GRPC_METRICS'")
}
csiEnableCSIHostNetwork, err := k8sutil.GetOperatorSetting(clientset, controllerutil.OperatorSettingConfigMapName, "CSI_ENABLE_HOST_NETWORK", "false")
if err != nil {
return errors.Wrap(err, "failed to determine if CSI Host Network is enabled")
}
if CSIParam.EnableCSIHostNetwork, err = strconv.ParseBool(csiEnableCSIHostNetwork); err != nil {
return errors.Wrap(err, "failed to parse value for 'CSI_ENABLE_HOST_NETWORK'")
}
CSIParam.CSIPluginImage, err = k8sutil.GetOperatorSetting(clientset, controllerutil.OperatorSettingConfigMapName, "ROOK_CSI_CEPH_IMAGE", DefaultCSIPluginImage)
if err != nil {
return errors.Wrap(err, "unable to configure CSI plugin image")
+1
View File
@@ -55,6 +55,7 @@ type Param struct {
PluginPriorityClassName string
ProvisionerPriorityClassName string
VolumeReplicationImage string
EnableCSIHostNetwork bool
EnableOMAPGenerator bool
EnableRBDSnapshotter bool
EnableCephFSSnapshotter bool