ceph: add support to disable snapshotter sidecar

In some cases the user dont want to run snapshotter
container either for CephFS or RBD. In that case the
user wont install the required snapshot CRD's due
to that the snapshotter sidecar container produces
lot of noisy logs.
Snapshotter will be enabled by default for both
CephFS and RBD, but with this PR we are providing
an option to disable snapshotter sidecar deployment
either for CephFS or RBD.

Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
This commit is contained in:
Madhu Rajanna committed 2021-01-21 15:29:55 +05:30
1 parent 9eabc639d8
commit 05c75b7084
8 files changed
+46

No files matched your search

+2
View File
@@ -99,6 +99,8 @@ The following tables lists the configurable parameters of the rook-operator char
| `discover.podLabels` | Labels to add to the discover pods. | <none> |
| `csi.enableRbdDriver` | Enable Ceph CSI RBD driver. | `true` |
| `csi.enableCephfsDriver` | Enable Ceph CSI CephFS driver. | `true` |
| `csi.enableCephfsSnapshotter` | Enable Snapshotter in CephFS provisioner pod. | `true` |
| `csi.enableRBDSnapshotter` | Enable Snapshotter in RBD provisioner pod. | `true` |
| `csi.pluginPriorityClassName` | PriorityClassName to be set on csi driver plugin pods. | <none> |
| `csi.provisionerPriorityClassName` | PriorityClassName to be set on csi driver provisioner pods. | <none> |
| `csi.enableOMAPGenerator` | EnableOMAP generator deploys omap sidecar in CSI provisioner pod, to enable it set it to true | `false` |
@@ -110,6 +110,10 @@ spec:
value: {{ .Values.csi.enableRbdDriver | quote }}
- name: ROOK_CSI_ENABLE_CEPHFS
value: {{ .Values.csi.enableCephfsDriver | quote }}
- name: CSI_ENABLE_CEPHFS_SNAPSHOTTER
value: {{ .Values.csi.enableCephfsSnapshotter | quote }}
- name: CSI_ENABLE_RBD_SNAPSHOTTER
value: {{ .Values.csi.enableRBDSnapshotter | quote }}
- name: CSI_PLUGIN_PRIORITY_CLASSNAME
value: {{ .Values.csi.pluginPriorityClassName | quote }}
- name: CSI_PROVISIONER_PRIORITY_CLASSNAME
+4
View File
@@ -56,6 +56,10 @@ csi:
enableRbdDriver: true
enableCephfsDriver: true
enableGrpcMetrics: 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.
enableRBDSnapshotter: true
# (Optional) set user created priorityclassName for csi plugin pods.
# pluginPriorityClassName: system-node-critical
@@ -42,6 +42,7 @@ spec:
volumeMounts:
- name: socket-dir
mountPath: /csi
{{ if .EnableCephFSSnapshotter }}
- name: csi-snapshotter
image: {{ .SnapshotterImage }}
args:
@@ -62,6 +63,7 @@ spec:
volumeMounts:
- name: socket-dir
mountPath: /csi
{{ end }}
- name: csi-resizer
image: {{ .ResizerImage }}
args:
@@ -70,6 +70,7 @@ spec:
volumeMounts:
- name: socket-dir
mountPath: /csi
{{ if .EnableRBDSnapshotter }}
- name: csi-snapshotter
image: {{ .SnapshotterImage }}
args:
@@ -85,6 +86,7 @@ spec:
volumeMounts:
- name: socket-dir
mountPath: /csi
{{ end }}
{{ if .EnableOMAPGenerator }}
- name: csi-omap-generator
image: {{ .CSIPluginImage }}
@@ -116,6 +116,12 @@ data:
# sidecar with CSI provisioner pod, to enable set it to true.
# CSI_ENABLE_OMAP_GENERATOR: "true"
# set to false to disable deployment of snapshotter container in CephFS provisioner pod.
CSI_ENABLE_CEPHFS_SNAPSHOTTER: "true"
# set to false to disable deployment of snapshotter container in RBD provisioner pod.
CSI_ENABLE_RBD_SNAPSHOTTER: "true"
# Enable Ceph Kernel clients on kernel < 4.17 which support quotas for Cephfs
# If you disable the kernel client, your application may be disrupted during upgrade.
# See the upgrade guide: https://rook.io/docs/rook/master/ceph-upgrade.html
@@ -39,6 +39,12 @@ data:
# it set it to false.
# CSI_ENABLE_OMAP_GENERATOR: "false"
# set to false to disable deployment of snapshotter container in CephFS provisioner pod.
CSI_ENABLE_CEPHFS_SNAPSHOTTER: "true"
# set to false to disable deployment of snapshotter container in RBD provisioner pod.
CSI_ENABLE_RBD_SNAPSHOTTER: "true"
# Enable cephfs kernel driver instead of ceph-fuse.
# If you disable the kernel client, your application may be disrupted during upgrade.
# See the upgrade guide: https://rook.io/docs/rook/master/ceph-upgrade.html
+20
View File
@@ -54,6 +54,8 @@ type Param struct {
PluginPriorityClassName string
ProvisionerPriorityClassName string
EnableOMAPGenerator bool
EnableRBDSnapshotter bool
EnableCephFSSnapshotter bool
LogLevel uint8
CephFSGRPCMetricsPort uint16
CephFSLivenessMetricsPort uint16
@@ -283,6 +285,24 @@ func startDrivers(clientset kubernetes.Interface, rookclientset rookclient.Inter
if strings.EqualFold(enableOMAPGenerator, "true") {
tp.EnableOMAPGenerator = true
}
// enable RBD snapshotter by default
tp.EnableRBDSnapshotter = true
enableRBDSnapshotter, err := k8sutil.GetOperatorSetting(clientset, controllerutil.OperatorSettingConfigMapName, "CSI_ENABLE_RBD_SNAPSHOTTER", "true")
if err != nil {
return errors.Wrap(err, "failed to load CSI_ENABLE_RBD_SNAPSHOTTER setting")
}
if strings.EqualFold(enableRBDSnapshotter, "false") {
tp.EnableRBDSnapshotter = false
}
// enable CephFS snapshotter by default
tp.EnableCephFSSnapshotter = true
enableCephFSSnapshotter, err := k8sutil.GetOperatorSetting(clientset, controllerutil.OperatorSettingConfigMapName, "CSI_ENABLE_CEPHFS_SNAPSHOTTER", "true")
if err != nil {
return errors.Wrap(err, "failed to load CSI_ENABLE_CEPHFS_SNAPSHOTTER setting")
}
if strings.EqualFold(enableCephFSSnapshotter, "false") {
tp.EnableCephFSSnapshotter = false
}
updateStrategy, err := k8sutil.GetOperatorSetting(clientset, controllerutil.OperatorSettingConfigMapName, "CSI_CEPHFS_PLUGIN_UPDATE_STRATEGY", rollingUpdate)
if err != nil {