Repository: rook/rook
Pull request #5321 (2020-04-23 17:57:04)

update documents and cleanup code
**Description of your changes:**

Update documents and comments for user's convenience. In addition, cleanup some code to improve maintainerbility.

**Which issue is resolved by this Pull Request:**

Nothing

**Checklist:**

- [o] **CommitLint Bot**: Commit titles and messages follow guidelines in the [developer guide](https://rook.io/docs/rook/master/development-flow.html#commit-structure).
- [o] **Skip Tests for Docs**: Add the flag for skipping the build if this is only a documentation change. See [here](https://github.com/rook/rook/blob/master/INSTALL.md#skip-ci) for the flag.
- [o] **Skip Unrelated Tests**: Add a flag to run tests for a specific storage provider. See [test options](https://github.com/rook/rook/blob/master/INSTALL.md#test-storage-provider).
- [o] Reviewed the developer guide on [Submitting a Pull Request](https://rook.io/docs/rook/master/development-flow.html#submitting-a-pull-request)
- [o] Documentation has been updated, if necessary.
- [o] Unit tests have been added, if necessary.
- [o] Integration tests have been added, if necessary.
- [o] Pending release notes updated with breaking and/or notable changes, if necessary.
- [o] Upgrade from previous release is tested and upgrade user guide is updated, if necessary.
- [o] Code generation (`make codegen`) has been run to update object specifications, if necessary.

[test yugabytedb]


Patch:
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 0064c029a..f5c8509ff 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -40,20 +40,20 @@ request and branch commits.
 
 ## Getting Started
 
-- Fork the repository on GitHub
-- Read the [install](INSTALL.md) for build and test instructions
-- Play with the project, submit bugs, submit patches!
+1. Fork the repository on GitHub
+1. Read the [install](INSTALL.md) for build and test instructions
+1. Play with the project, submit bugs, submit patches!
 
 ## Contribution Flow
 
 This is a rough outline of what a contributor's workflow looks like:
 
-- Create a branch from where you want to base your work (usually master).
-- Make your changes and arrange them in readable commits.
-- Make sure your commit messages are in the proper format (see below).
-- Push your changes to the branch in your fork of the repository.
-- Make sure all tests pass, and add any new tests as appropriate.
-- Submit a pull request to the original repository.
+1. Create a branch from where you want to base your work (usually master).
+1. Make your changes and arrange them in readable commits.
+1. Make sure your commit messages are in the proper format (see below).
+1. Push your changes to the branch in your fork of the repository.
+1. Make sure all tests pass, and add any new tests as appropriate.
+1. Submit a pull request to the original repository.
 
 For detailed contribution instructions, refer to the [development flow](Documentation/development-flow.md).
 
diff --git a/Documentation/ceph-cluster-crd.md b/Documentation/ceph-cluster-crd.md
index 30e1a5763..0e0801e97 100755
--- a/Documentation/ceph-cluster-crd.md
+++ b/Documentation/ceph-cluster-crd.md
@@ -107,7 +107,7 @@ Settings can be specified at the global level to apply to the cluster as a whole
   Using the `v14` or similar tag is not recommended in production because it may lead to inconsistent versions of the image running across different nodes in the cluster.
   * `allowUnsupported`: If `true`, allow an unsupported major version of the Ceph release. Currently `nautilus` and `octopus` are supported. Future versions such as `pacific` would require this to be set to `true`. Should be set to `false` in production.
 * `dataDirHostPath`: The path on the host ([hostPath](https://kubernetes.io/docs/concepts/storage/volumes/#hostpath)) where config and data should be stored for each of the services. If the directory does not exist, it will be created. Because this directory persists on the host, it will remain after pods are deleted. Following paths and any of their subpaths **must not be used**: `/etc/ceph`, `/rook` or `/var/log/ceph`.
-  * On **Minikube** environments, use `/data/rook`. Minikube boots into a tmpfs but it provides some [directories](https://github.com/kubernetes/minikube/blob/master/site/content/en/docs/handbook/persistent_volumes.md#a-note-on-mounts-persistence-and-minikube-hosts) where files can be persisted across reboots. Using one of these directories will ensure that Rook's data and configuration files are persisted and that enough storage space is available.
+  * On **Minikube** environments, use `/data/rook`. Minikube boots into a tmpfs but it provides some [directories](https://github.com/kubernetes/minikube/blob/master/docs/persistent_volumes.md) where files can be persisted across reboots. Using one of these directories will ensure that Rook's data and configuration files are persisted and that enough storage space is available.
   * **WARNING**: For test scenarios, if you delete a cluster and start a new cluster on the same hosts, the path used by `dataDirHostPath` must be deleted. Otherwise, stale keys and other config will remain from the previous cluster and the new mons will fail to start.
 If this value is empty, each pod will get an ephemeral directory to store their config files that is tied to the lifetime of the pod running on that node. More details can be found in the Kubernetes [empty dir docs](https://kubernetes.io/docs/concepts/storage/volumes/#emptydir).
 * `skipUpgradeChecks`: if set to true Rook won't perform any upgrade checks on Ceph daemons during an upgrade. Use this at **YOUR OWN RISK**, only if you know what you're doing. To understand Rook's upgrade process of Ceph, read the [upgrade doc](Documentation/ceph-upgrade.html#ceph-version-upgrades).
diff --git a/Documentation/ceph-examples.md b/Documentation/ceph-examples.md
index 7c6584493..2c7774a0c 100644
--- a/Documentation/ceph-examples.md
+++ b/Documentation/ceph-examples.md
@@ -46,11 +46,7 @@ that will influence how the operator configures the storage. It is important to
 the cluster. These examples represent a very small set of the different ways to configure the storage.
 
 * `cluster.yaml`: This file contains common settings for a production storage cluster. Requires at least three nodes.
-* `cluster-test.yaml`: Settings for a test cluster where redundancy is not configured. Requires only a single node.
 * `cluster-on-pvc.yaml`: This file contains common settings for backing the Ceph Mons and OSDs by PVs. Useful when running in cloud environments or where local PVs have been created for Ceph to consume.
-* `cluster-external`: Connect to an [external Ceph cluster](ceph-cluster-crd.md#external-cluster) with minimal access to monitor the health of the cluster and connect to the storage.
-* `cluster-external-management`: Connect to an [external Ceph cluster](ceph-cluster-crd.md#external-cluster) with the admin key of the external cluster to enable
-  remote creation of pools and configure services such as an [Object Store](ceph-object.md) or a [Shared Filesystem](ceph-filesystem.md).
 
 See the [Cluster CRD](ceph-cluster-crd.md) topic for more details and more examples for the settings.
 
diff --git a/Documentation/ceph-quickstart.md b/Documentation/ceph-quickstart.md
index d7abd9ecf..3155b3dbc 100644
--- a/Documentation/ceph-quickstart.md
+++ b/Documentation/ceph-quickstart.md
@@ -39,15 +39,11 @@ kubectl create -f cluster.yaml
 
 After the cluster is running, you can create [block, object, or file](#storage) storage to be consumed by other applications in your cluster.
 
-### Cluster Environments
+### Production Environments
 
-The Rook documentation is focused around starting Rook in a production environment. Examples are also
-provided to relax some settings for test environments. When creating the cluster later in this guide, consider these example cluster manifests:
-- [cluster.yaml](https://github.com/rook/rook/blob/{{ branchName }}/cluster/examples/kubernetes/ceph/cluster.yaml): Cluster settings for a production cluster running on bare metal
-- [cluster-on-pvc.yaml](https://github.com/rook/rook/blob/{{ branchName }}/cluster/examples/kubernetes/ceph/cluster-on-pvc.yaml): Cluster settings for a production cluster running in a dynamic cloud environment
-- [cluster-test.yaml](https://github.com/rook/rook/blob/{{ branchName }}/cluster/examples/kubernetes/ceph/cluster-test.yaml): Cluster settings for a test environment such as minikube.
-
-See the [Ceph examples](ceph-examples.md) for more details.
+For production environments it is required to have local storage devices attached to your nodes.
+In this walk-through, the requirement of local storage devices is relaxed so you can get a cluster up and running
+as a "test" environment to experiment with Rook. See the [Ceph examples](ceph-examples.md) for more details.
 
 ## Deploy the Rook Operator
 
diff --git a/Documentation/ceph-teardown.md b/Documentation/ceph-teardown.md
index 7f03db438..ccf9c5732 100644
--- a/Documentation/ceph-teardown.md
+++ b/Documentation/ceph-teardown.md
@@ -115,17 +115,7 @@ The operator is responsible for removing the finalizer after the mounts have bee
 If for some reason the operator is not able to remove the finalizer (ie. the operator is not running anymore), you can delete the finalizer manually with the following command:
 
 ```console
-for CRD in $(kubectl get crd -n rook-ceph | awk '/ceph.rook.io/ {print $1}'); do kubectl patch crd -n rook-ceph $CRD --type merge -p '{"metadata":{"finalizers": [null]}}'; done
-```
-
-This command will patch the following CRDs on v1.3:
-```console
-cephblockpools.ceph.rook.io
-cephclients.ceph.rook.io
-cephfilesystems.ceph.rook.io
-cephnfses.ceph.rook.io
-cephobjectstores.ceph.rook.io
-cephobjectstoreusers.ceph.rook.io
+kubectl -n rook-ceph patch crd cephclusters.ceph.rook.io --type merge -p '{"metadata":{"finalizers": [null]}}'
 ```
 
 Within a few seconds you should see that the cluster CRD has been deleted and will no longer block other cleanup such as deleting the `rook-ceph` namespace.
diff --git a/Documentation/helm-operator.md b/Documentation/helm-operator.md
index d507294d2..926e5afff 100644
--- a/Documentation/helm-operator.md
+++ b/Documentation/helm-operator.md
@@ -132,7 +132,7 @@ The following tables lists the configurable parameters of the rook-operator char
 | `csi.enableSnapshotter`            | Enable deployment of snapshotter container in ceph-csi provisioner.                                                         | `true`                                                 |
 | `csi.forceCephFSKernelClient`      | Enable Ceph Kernel clients on kernel < 4.17 which support quotas for Cephfs.                                                | `true`                                                 |
 | `csi.kubeletDirPath`               | Kubelet root directory path (if the Kubelet uses a different path for the `--root-dir` flag)                                | `/var/lib/kubelet`                                     |
-| `csi.cephcsi.image`                | Ceph CSI image.                                                                                                             | `quay.io/cephcsi/cephcsi:v2.1.0`                       |
+| `csi.cephcsi.image`                | Ceph CSI image.                                                                                                             | `quay.io/cephcsi/cephcsi:v2.0.0`                       |
 | `csi.rbdPluginUpdateStrategy`      | CSI Rbd plugin daemonset update strategy, supported values are OnDelete and RollingUpdate.                                  | `OnDelete`                                             |
 | `csi.cephFSPluginUpdateStrategy`   | CSI CephFS plugin daemonset update strategy, supported values are OnDelete and RollingUpdate.                               | `OnDelete`                                             |
 | `csi.registrar.image`              | Kubernetes CSI registrar image.                                                                                             | `quay.io/k8scsi/csi-node-driver-registrar:v1.2.0`      |
diff --git a/cluster/charts/rook-ceph/templates/clusterrole.yaml b/cluster/charts/rook-ceph/templates/clusterrole.yaml
index 7de6c0465..f5ba5bb9c 100644
--- a/cluster/charts/rook-ceph/templates/clusterrole.yaml
+++ b/cluster/charts/rook-ceph/templates/clusterrole.yaml
@@ -10,7 +10,7 @@ metadata:
 aggregationRule:
   clusterRoleSelectors:
   - matchLabels:
-      rbac.ceph.rook.io/aggregate-to-rook-ceph-cluster-mgmt: "true"
+      rbac.rook.ceph.io/aggregate-to-rook-ceph-cluster-mgmt: "true"
 rules: []
 ---
 apiVersion: rbac.authorization.k8s.io/v1beta1
@@ -20,7 +20,7 @@ metadata:
   labels:
     operator: rook
     storage-backend: ceph
-    rbac.ceph.rook.io/aggregate-to-rook-ceph-cluster-mgmt: "true"
+    rbac.rook.ceph.io/aggregate-to-rook-ceph-cluster-mgmt: "true"
 rules:
 - apiGroups:
   - ""
@@ -497,7 +497,7 @@ aggregationRule:
       rbac.ceph.rook.io/aggregate-to-rook-ceph-system-psp-user: "true"
 rules: []
 ---
-apiVersion: rbac.authorization.k8s.io/v1
+apiVersion: rbac.authorization.k8s.io/v1beta1
 kind: ClusterRole
 metadata:
   name: 'psp:rook'
diff --git a/cluster/charts/rook-ceph/templates/resources.yaml b/cluster/charts/rook-ceph/templates/resources.yaml
index 158a765b5..aa10f1ce6 100644
--- a/cluster/charts/rook-ceph/templates/resources.yaml
+++ b/cluster/charts/rook-ceph/templates/resources.yaml
@@ -117,10 +117,7 @@ spec:
                             pattern: ^(true|false)$
                       useAllDevices:
                         type: boolean
-                      deviceFilter:
-                        type: string
-                      devicePathFilter:
-                        type: string
+                      deviceFilter: {}
                       devices:
                         type: array
                         items:
@@ -132,10 +129,7 @@ spec:
                   type: array
                 useAllDevices:
                   type: boolean
-                deviceFilter:
-                  type: string
-                devicePathFilter:
-                  type: string
+                deviceFilter: {}
                 config: {}
                 storageClassDeviceSets: {}
             monitoring:
@@ -144,6 +138,10 @@ spec:
                   type: boolean
                 rulesNamespace:
                   type: string
+            rbdMirroring:
+              properties:
+                workers:
+                  type: integer
             removeOSDsIfOutAndSafeToRemove:
               type: boolean
             external:
@@ -169,14 +167,10 @@ spec:
     - name: Age
       type: date
       JSONPath: .metadata.creationTimestamp
-    - name: Phase
-      type: string
-      description: Phase
-      JSONPath: .status.phase
-    - name: Message
+    - name: State
       type: string
-      description: Message
-      JSONPath: .status.message
+      description: Current State
+      JSONPath: .status.state
     - name: Health
       type: string
       description: Ceph Health
diff --git a/cluster/charts/rook-ceph/templates/role.yaml b/cluster/charts/rook-ceph/templates/role.yaml
index f9b912f0d..cc005564e 100644
--- a/cluster/charts/rook-ceph/templates/role.yaml
+++ b/cluster/charts/rook-ceph/templates/role.yaml
@@ -4,36 +4,26 @@ apiVersion: rbac.authorization.k8s.io/v1beta1
 kind: Role
 metadata:
   name: rook-ceph-system
-  namespace:  {{  .Release.Namespace }}
   labels:
     operator: rook
     storage-backend: ceph
 rules:
 - apiGroups:
   - ""
+  - apps
+  - extensions
   resources:
   - pods
   - configmaps
   - services
-  verbs:
-  - get
-  - list
-  - watch
-  - patch
-  - create
-  - update
-  - delete
-- apiGroups:
-  - apps
-  - extensions
-  resources:
   - daemonsets
   - statefulsets
-  - deployments
+  - deployment
   verbs:
   - get
   - list
   - watch
+  - patch
   - create
   - update
   - delete
@@ -48,7 +38,6 @@ kind: Role
 apiVersion: rbac.authorization.k8s.io/v1beta1
 metadata:
   name: rook-ceph-osd
-  namespace:  {{  .Release.Namespace }}
 rules:
 - apiGroups: [""]
   resources: ["configmaps"]
@@ -62,7 +51,6 @@ kind: Role
 apiVersion: rbac.authorization.k8s.io/v1beta1
 metadata:
   name: rook-ceph-mgr
-  namespace:  {{  .Release.Namespace }}
 rules:
 - apiGroups:
   - ""
@@ -97,7 +85,6 @@ kind: Role
 apiVersion: rbac.authorization.k8s.io/v1beta1
 metadata:
   name: rook-ceph-cmd-reporter
-  namespace:  {{  .Release.Namespace }}
 rules:
 - apiGroups:
   - ""
@@ -116,7 +103,6 @@ kind: Role
 apiVersion: rbac.authorization.k8s.io/v1
 metadata:
   name: cephfs-external-provisioner-cfg
-  namespace:  {{  .Release.Namespace }}
 rules:
   - apiGroups: [""]
     resources: ["endpoints"]
@@ -132,7 +118,6 @@ kind: Role
 apiVersion: rbac.authorization.k8s.io/v1
 metadata:
   name: rbd-external-provisioner-cfg
-  namespace:  {{  .Release.Namespace }}
 rules:
   - apiGroups: [""]
     resources: ["endpoints"]
diff --git a/cluster/charts/rook-ceph/templates/serviceaccount.yaml b/cluster/charts/rook-ceph/templates/serviceaccount.yaml
index b22ce66d3..6bbe75988 100644
--- a/cluster/charts/rook-ceph/templates/serviceaccount.yaml
+++ b/cluster/charts/rook-ceph/templates/serviceaccount.yaml
@@ -3,7 +3,6 @@ apiVersion: v1
 kind: ServiceAccount
 metadata:
   name: rook-ceph-system
-  namespace:  {{  .Release.Namespace }}
   labels:
     operator: rook
     storage-backend: ceph
@@ -15,7 +14,6 @@ apiVersion: v1
 kind: ServiceAccount
 metadata:
   name: rook-ceph-osd
-  namespace:  {{  .Release.Namespace }}
   labels:
     operator: rook
     storage-backend: ceph
@@ -27,7 +25,6 @@ apiVersion: v1
 kind: ServiceAccount
 metadata:
   name: rook-ceph-mgr
-  namespace:  {{  .Release.Namespace }}
   labels:
     operator: rook
     storage-backend: ceph
@@ -38,7 +35,6 @@ apiVersion: v1
 kind: ServiceAccount
 metadata:
   name: rook-ceph-cmd-reporter
-  namespace:  {{  .Release.Namespace }}
   labels:
     operator: rook
     storage-backend: ceph
@@ -50,7 +46,6 @@ apiVersion: v1
 kind: ServiceAccount
 metadata:
   name: rook-csi-cephfs-plugin-sa
-  namespace:  {{  .Release.Namespace }}
 {{ template "imagePullSecrets" . }}
 ---
 # Service account for the cephfs csi provisioner
@@ -58,7 +53,6 @@ apiVersion: v1
 kind: ServiceAccount
 metadata:
   name: rook-csi-cephfs-provisioner-sa
-  namespace:  {{  .Release.Namespace }}
 {{ template "imagePullSecrets" . }}
 ---
 # Service account for the rbd csi driver
@@ -66,7 +60,6 @@ apiVersion: v1
 kind: ServiceAccount
 metadata:
   name: rook-csi-rbd-plugin-sa
-  namespace:  {{  .Release.Namespace }}
 {{ template "imagePullSecrets" . }}
 ---
 # Service account for the rbd csi provisioner
@@ -74,5 +67,4 @@ apiVersion: v1
 kind: ServiceAccount
 metadata:
   name: rook-csi-rbd-provisioner-sa
-  namespace:  {{  .Release.Namespace }}
 {{ template "imagePullSecrets" . }}
diff --git a/cluster/charts/rook-ceph/values.yaml b/cluster/charts/rook-ceph/values.yaml
index cf193d641..f9b87b695 100644
--- a/cluster/charts/rook-ceph/values.yaml
+++ b/cluster/charts/rook-ceph/values.yaml
@@ -94,7 +94,7 @@ csi:
   #rbdLivenessMetricsPort: 9080
   #kubeletDirPath: /var/lib/kubelet
   #cephcsi:
-    #image: quay.io/cephcsi/cephcsi:v2.1.0
+    #image: quay.io/cephcsi/cephcsi:v2.0.1
   #registrar:
     #image: quay.io/k8scsi/csi-node-driver-registrar:v1.2.0
   #provisioner:
diff --git a/cluster/examples/kubernetes/ceph/common.yaml b/cluster/examples/kubernetes/ceph/common.yaml
index dd1dc5896..df1cd703a 100644
--- a/cluster/examples/kubernetes/ceph/common.yaml
+++ b/cluster/examples/kubernetes/ceph/common.yaml
@@ -122,7 +122,7 @@ spec:
                             type: string
                           storeType:
                             type: string
-                            pattern: ^(bluestore)$
+                            pattern: ^(filestore|bluestore)$
                           databaseSizeMB:
                             type: string
                           walSizeMB:
diff --git a/cluster/examples/kubernetes/ceph/operator-openshift.yaml b/cluster/examples/kubernetes/ceph/operator-openshift.yaml
index aa0a2c1e4..1c003d4a3 100644
--- a/cluster/examples/kubernetes/ceph/operator-openshift.yaml
+++ b/cluster/examples/kubernetes/ceph/operator-openshift.yaml
@@ -122,7 +122,7 @@ data:
   # The default version of CSI supported by Rook will be started. To change the version
   # of the CSI driver to something other than what is officially supported, change
   # these images to the desired release of the CSI driver.
-  # ROOK_CSI_CEPH_IMAGE: "quay.io/cephcsi/cephcsi:v2.1.0"
+  # ROOK_CSI_CEPH_IMAGE: "quay.io/cephcsi/cephcsi:v2.0.1"
   # ROOK_CSI_REGISTRAR_IMAGE: "quay.io/k8scsi/csi-node-driver-registrar:v1.2.0"
   # ROOK_CSI_RESIZER_IMAGE: "quay.io/k8scsi/csi-resizer:v0.4.0"
   # ROOK_CSI_PROVISIONER_IMAGE: "quay.io/k8scsi/csi-provisioner:v1.4.0"
diff --git a/cluster/examples/kubernetes/ceph/operator.yaml b/cluster/examples/kubernetes/ceph/operator.yaml
index d2b521a81..4e190a681 100644
--- a/cluster/examples/kubernetes/ceph/operator.yaml
+++ b/cluster/examples/kubernetes/ceph/operator.yaml
@@ -46,7 +46,7 @@ data:
   # The default version of CSI supported by Rook will be started. To change the version
   # of the CSI driver to something other than what is officially supported, change
   # these images to the desired release of the CSI driver.
-  # ROOK_CSI_CEPH_IMAGE: "quay.io/cephcsi/cephcsi:v2.1.0"
+  # ROOK_CSI_CEPH_IMAGE: "quay.io/cephcsi/cephcsi:v2.0.1"
   # ROOK_CSI_REGISTRAR_IMAGE: "quay.io/k8scsi/csi-node-driver-registrar:v1.2.0"
   # ROOK_CSI_RESIZER_IMAGE: "quay.io/k8scsi/csi-resizer:v0.4.0"
   # ROOK_CSI_PROVISIONER_IMAGE: "quay.io/k8scsi/csi-provisioner:v1.4.0"
diff --git a/pkg/clusterd/disk.go b/pkg/clusterd/disk.go
index 80b00b158..136b45f47 100644
--- a/pkg/clusterd/disk.go
+++ b/pkg/clusterd/disk.go
@@ -62,8 +62,7 @@ func DiscoverDevices(executor exec.Executor) ([]*sys.LocalDisk, error) {
 		// Populate device information coming from lsblk
 		disk, err := PopulateDeviceInfo(d, executor)
 		if err != nil {
-			// skip device if lsblk fails
-			logger.Warningf("skipping device %q because 'lsblk' failed. %v", d, err)
+			logger.Warningf("skipping device %q. %v", d, err)
 			continue
 		}
 
diff --git a/pkg/daemon/ceph/osd/volume.go b/pkg/daemon/ceph/osd/volume.go
index 26d34b1da..6e8265db2 100644
--- a/pkg/daemon/ceph/osd/volume.go
+++ b/pkg/daemon/ceph/osd/volume.go
@@ -396,11 +396,6 @@ func (a *OsdAgent) initializeDevices(context *clusterd.Context, devices *DeviceO
 	metadataDevices := make(map[string]map[string]string)
 	for name, device := range devices.Entries {
 		if device.Data == -1 {
-			if device.Metadata != nil {
-				logger.Infof("skipping metadata device %s config since it will be configured with a data device", name)
-				continue
-			}
-
 			logger.Infof("configuring new device %s", name)
 			deviceArg := path.Join("/dev", name)
 			// ceph-volume prefers to use /dev/mapper/<name> if the device has this kind of alias
diff --git a/pkg/operator/ceph/cluster/osd/osd.go b/pkg/operator/ceph/cluster/osd/osd.go
index 33d3f8bf3..79adce179 100644
--- a/pkg/operator/ceph/cluster/osd/osd.go
+++ b/pkg/operator/ceph/cluster/osd/osd.go
@@ -704,7 +704,7 @@ func (c *Cluster) getOSDInfo(d *apps.Deployment) ([]OSDInfo, error) {
 			}
 			osd.LVBackedPV = lvBackedPV
 		}
-		if envVar.Name == "ROOK_METADATA_DEVICE" {
+		if envVar.Name == osdMetadataDeviceEnvVarName {
 			osd.MetadataPath = envVar.Value
 		}
 	}
diff --git a/pkg/operator/ceph/csi/spec.go b/pkg/operator/ceph/csi/spec.go
index 914da0900..036fb9710 100644
--- a/pkg/operator/ceph/csi/spec.go
+++ b/pkg/operator/ceph/csi/spec.go
@@ -98,7 +98,7 @@ var (
 // manually challenging.
 var (
 	// image names
-	DefaultCSIPluginImage   = "quay.io/cephcsi/cephcsi:v2.1.0"
+	DefaultCSIPluginImage   = "quay.io/cephcsi/cephcsi:v2.0.1"
 	DefaultRegistrarImage   = "quay.io/k8scsi/csi-node-driver-registrar:v1.2.0"
 	DefaultProvisionerImage = "quay.io/k8scsi/csi-provisioner:v1.4.0"
 	DefaultAttacherImage    = "quay.io/k8scsi/csi-attacher:v2.1.0"
diff --git a/pkg/operator/ceph/csi/version.go b/pkg/operator/ceph/csi/version.go
index 610bb261e..c58626745 100644
--- a/pkg/operator/ceph/csi/version.go
+++ b/pkg/operator/ceph/csi/version.go
@@ -29,8 +29,7 @@ var (
 	minimum = CephCSIVersion{2, 0, 0}
 
 	//supportedCSIVersions are versions that rook supports
-	releaseV210          = CephCSIVersion{2, 1, 0}
-	supportedCSIVersions = []CephCSIVersion{minimum, releaseV210}
+	supportedCSIVersions = []CephCSIVersion{minimum}
 
 	// for parsing the output of `cephcsi`
 	versionCSIPattern = regexp.MustCompile(`v(\d+)\.(\d+)\.(\d+)`)
diff --git a/pkg/operator/ceph/object/spec.go b/pkg/operator/ceph/object/spec.go
index a33c47db9..2f6a04145 100644
--- a/pkg/operator/ceph/object/spec.go
+++ b/pkg/operator/ceph/object/spec.go
@@ -141,7 +141,7 @@ func (c *clusterConfig) makeDaemonContainer(rgwConfig *rgwConfig) v1.Container {
 				controller.DaemonFlags(c.clusterInfo, strings.TrimPrefix(generateCephXUser(rgwConfig.ResourceName), "client.")),
 				"--foreground",
 				cephconfig.NewFlag("rgw frontends", fmt.Sprintf("%s %s", rgwFrontendName, c.portString())),
-				cephconfig.NewFlag("host", controller.ContainerEnvVarReference("POD_NAME")),
+				cephconfig.NewFlag("host", controller.ContainerEnvVarReference(k8sutil.PodNameEnvVar)),
 				cephconfig.NewFlag("rgw-mime-types-file", mimeTypesMountPath()),
 			),
 		),
diff --git a/pkg/operator/yugabytedb/controller.go b/pkg/operator/yugabytedb/controller.go
index 0a6c0f7b8..4b04ad9ad 100644
--- a/pkg/operator/yugabytedb/controller.go
+++ b/pkg/operator/yugabytedb/controller.go
@@ -70,7 +70,6 @@ const (
 	envGetHostsFromVal          = "dns"
 	envPodIP                    = "POD_IP"
 	envPodIPVal                 = "status.podIP"
-	envPodName                  = "POD_NAME"
 	envPodNameVal               = "metadata.name"
 	yugabyteDBImageName         = "yugabytedb/yugabyte:2.0.10.0-b4"
 	podCPULimitDefault          = "2"
diff --git a/pkg/operator/yugabytedb/create_controller.go b/pkg/operator/yugabytedb/create_controller.go
index d902712a1..51cc7dba5 100644
--- a/pkg/operator/yugabytedb/create_controller.go
+++ b/pkg/operator/yugabytedb/create_controller.go
@@ -331,7 +331,7 @@ func createContainer(cluster *cluster, containerImage string, isTServerStatefuls
 				},
 			},
 			{
-				Name: envPodName,
+				Name: k8sutil.PodNameEnvVar,
 				ValueFrom: &v1.EnvVarSource{
 					FieldRef: &v1.ObjectFieldSelector{
 						FieldPath: envPodNameVal,


Test patch:
diff --git a/cluster/examples/kubernetes/ceph/cluster-test.yaml b/cluster/examples/kubernetes/ceph/cluster-test.yaml
deleted file mode 100644
index 74550beba..000000000
--- a/cluster/examples/kubernetes/ceph/cluster-test.yaml
+++ /dev/null
@@ -1,32 +0,0 @@
-#################################################################################################################
-# Define the settings for the rook-ceph cluster with common settings for a small test cluster.
-# All nodes with available raw devices will be used for the Ceph cluster. One node is sufficient
-# in this example.
-
-# For example, to create the cluster:
-#   kubectl create -f common.yaml
-#   kubectl create -f operator.yaml
-#   kubectl create -f cluster-test.yaml
-#################################################################################################################
-
-apiVersion: ceph.rook.io/v1
-kind: CephCluster
-metadata:
-  name: my-cluster
-  namespace: rook-ceph
-spec:
-  dataDirHostPath: /var/lib/rook
-  cephVersion:
-    image: ceph/ceph:v15
-    allowUnsupported: true
-  mon:
-    count: 1
-    allowMultiplePerNode: true
-  dashboard:
-    enabled: true
-  crashCollector:
-    disable: true
-  storage:
-    useAllNodes: true
-    useAllDevices: true
-    #deviceFilter:
diff --git a/pkg/operator/ceph/csi/version_test.go b/pkg/operator/ceph/csi/version_test.go
index 4b46fa472..c33b09ba4 100644
--- a/pkg/operator/ceph/csi/version_test.go
+++ b/pkg/operator/ceph/csi/version_test.go
@@ -23,57 +23,33 @@ import (
 )
 
 var (
-	testMinVersion         = CephCSIVersion{2, 0, 0}
-	testReleaseV210        = CephCSIVersion{2, 1, 0}
-	testVersionUnsupported = CephCSIVersion{2, 2, 0}
+	testVersion            = CephCSIVersion{2, 0, 0}
+	testVersionUnsupported = CephCSIVersion{2, 1, 0}
 )
 
 func TestIsAtLeast(t *testing.T) {
 	// Test version which is smaller
 	var version = CephCSIVersion{1, 40, 10}
-	ret := testMinVersion.isAtLeast(&version)
+	ret := testVersion.isAtLeast(&version)
 	assert.Equal(t, true, ret)
 
 	// Test version which is equal
-	ret = testMinVersion.isAtLeast(&testMinVersion)
+	ret = testVersion.isAtLeast(&testVersion)
 	assert.Equal(t, true, ret)
 
 	// Test version which is greater (minor)
 	version = CephCSIVersion{2, 1, 0}
-	ret = testMinVersion.isAtLeast(&version)
+	ret = testVersion.isAtLeast(&version)
 	assert.Equal(t, false, ret)
 
-	// Test version which is greater (bugfix)
-	version = CephCSIVersion{2, 2, 0}
-	ret = testMinVersion.isAtLeast(&version)
-	assert.Equal(t, false, ret)
-
-	// Test for v2.1.0
 	// Test version which is greater (bugfix)
 	version = CephCSIVersion{2, 0, 1}
-	ret = testReleaseV210.isAtLeast(&version)
-	assert.Equal(t, true, ret)
-
-	// Test version which is equal
-	ret = testReleaseV210.isAtLeast(&testReleaseV210)
-	assert.Equal(t, true, ret)
-
-	// Test version which is greater (minor)
-	version = CephCSIVersion{2, 1, 1}
-	ret = testReleaseV210.isAtLeast(&version)
-	assert.Equal(t, false, ret)
-
-	// Test version which is greater (bugfix)
-	version = CephCSIVersion{2, 2, 0}
-	ret = testMinVersion.isAtLeast(&version)
+	ret = testVersion.isAtLeast(&version)
 	assert.Equal(t, false, ret)
 }
 
 func TestSupported(t *testing.T) {
-	ret := testMinVersion.Supported()
-	assert.Equal(t, true, ret)
-
-	ret = testReleaseV210.Supported()
+	ret := testVersion.Supported()
 	assert.Equal(t, true, ret)
 
 	ret = testVersionUnsupported.Supported()
diff --git a/pkg/operator/yugabytedb/controller_test.go b/pkg/operator/yugabytedb/controller_test.go
index da657e42b..8bba2d4cc 100644
--- a/pkg/operator/yugabytedb/controller_test.go
+++ b/pkg/operator/yugabytedb/controller_test.go
@@ -441,7 +441,7 @@ func TestOnAdd(t *testing.T) {
 			},
 		},
 		{
-			Name: envPodName,
+			Name: k8sutil.PodNameEnvVar,
 			ValueFrom: &v1.EnvVarSource{
 				FieldRef: &v1.ObjectFieldSelector{
 					FieldPath: envPodNameVal,
@@ -530,7 +530,7 @@ func TestOnAdd(t *testing.T) {
 			},
 		},
 		{
-			Name: envPodName,
+			Name: k8sutil.PodNameEnvVar,
 			ValueFrom: &v1.EnvVarSource{
 				FieldRef: &v1.ObjectFieldSelector{
 					FieldPath: envPodNameVal,
diff --git a/tests/framework/installer/ceph_manifests.go b/tests/framework/installer/ceph_manifests.go
index a2b22461e..9e01c3b7c 100644
--- a/tests/framework/installer/ceph_manifests.go
+++ b/tests/framework/installer/ceph_manifests.go
@@ -1926,7 +1926,7 @@ spec:
   storage:
     useAllNodes: true
     useAllDevices: true
-    deviceFilter: ''
+    deviceFilter:
     config:
       ` + store + `
       databaseSizeMB: "1024"