Skip to content

Commit

Permalink
csi: no longer install the volumereplication crds from rook
Browse files Browse the repository at this point in the history
The volume replication CRDs are an external component, not owned by Rook.
Therefore, they should be installed as any other independent component
in case the admin will install other consumers of the volumereplication CRDs
in the future in addition to Rook and the CSI driver.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
(cherry picked from commit c420f23)
  • Loading branch information
travisn committed Oct 6, 2021
1 parent c7bfade commit 0bd34eb
Show file tree
Hide file tree
Showing 13 changed files with 379 additions and 601 deletions.
20 changes: 15 additions & 5 deletions Documentation/ceph-csi-drivers.md
Expand Up @@ -77,8 +77,18 @@ PVC will be updated to new size.
## RBD Mirroring

To support RBD Mirroring, the [Volume Replication Operator](https://github.com/csi-addons/volume-replication-operator/blob/main/README.md) will be started in the RBD provisioner pod.
Volume Replication Operator is a kubernetes operator that provides common and reusable APIs for storage disaster recovery. It is based on [csi-addons/spec](https://github.com/csi-addons/spec) specification and can be used by any storage provider.
It follows controller pattern and provides extended APIs for storage disaster recovery. The extended APIs are provided via Custom Resource Definition (CRD).
To enable volume replication:
- For Helm deployments see the [helm settings](helm-operator.md#configuration).
- For non-Helm deployments set `CSI_ENABLE_VOLUME_REPLICATION: "true"` in the operator.yaml
The Volume Replication Operator is a kubernetes operator that provides common and reusable APIs for storage disaster recovery. It is based on [csi-addons/spec](https://github.com/csi-addons/spec) specification and can be used by any storage provider.
It follows the controller pattern and provides extended APIs for storage disaster recovery. The extended APIs are provided via Custom Resource Definitions (CRDs).

### Enable volume replication

1. Install the volume replication CRDs:

```console
kubectl create -f https://raw.githubusercontent.com/csi-addons/volume-replication-operator/v0.1.0/config/crd/bases/replication.storage.openshift.io_volumereplications.yaml
kubectl create -f https://raw.githubusercontent.com/csi-addons/volume-replication-operator/v0.1.0/config/crd/bases/replication.storage.openshift.io_volumereplicationclasses.yaml
```

2. Enable the volume replication controller:
- For Helm deployments see the [csi.volumeReplication.enabled setting](helm-operator.md#configuration).
- For non-Helm deployments set `CSI_ENABLE_VOLUME_REPLICATION: "true"` in operator.yaml
7 changes: 0 additions & 7 deletions build/crds/build-crds.sh
Expand Up @@ -62,11 +62,6 @@ generating_crds_v1alpha2() {
# "$CONTROLLER_GEN_BIN_PATH" "$CRD_OPTIONS" paths="./vendor/github.com/kube-object-storage/lib-bucket-provisioner/pkg/apis/objectbucket.io/v1alpha1" output:crd:artifacts:config="$OLM_CATALOG_DIR"
}

generate_vol_rep_crds() {
echo "Generating volume replication crds in crds.yaml"
"$CONTROLLER_GEN_BIN_PATH" "$CRD_OPTIONS" paths="github.com/csi-addons/volume-replication-operator/api/v1alpha1" output:crd:artifacts:config="$OLM_CATALOG_DIR"
}

generating_main_crd() {
true > "$CEPH_CRDS_FILE_PATH"
true > "$CEPH_HELM_CRDS_FILE_PATH"
Expand Down Expand Up @@ -111,8 +106,6 @@ if [ -z "$NO_OB_OBC_VOL_GEN" ]; then
generating_crds_v1alpha2
fi

generate_vol_rep_crds

generating_main_crd

for crd in "$OLM_CATALOG_DIR/"*.yaml; do
Expand Down
380 changes: 119 additions & 261 deletions cluster/charts/rook-ceph/templates/resources.yaml

Large diffs are not rendered by default.

4 changes: 3 additions & 1 deletion cluster/charts/rook-ceph/values.yaml
Expand Up @@ -288,7 +288,9 @@ csi:
#cephfsPodLabels: "key1=value1,key2=value2"
# Labels to add to the CSI RBD Deployments and DaemonSets Pods.
#rbdPodLabels: "key1=value1,key2=value2"
# Enable volume replication controller
# Enable the volume replication controller.
# Before enabling, ensure the Volume Replication CRDs are created.
# See https://rook.io/docs/rook/latest/ceph-csi-drivers.html#rbd-mirroring
volumeReplication:
enabled: false
#image: "quay.io/csiaddons/volumereplication-operator:v0.1.0"
Expand Down
378 changes: 119 additions & 259 deletions cluster/examples/kubernetes/ceph/crds.yaml

Large diffs are not rendered by default.

4 changes: 3 additions & 1 deletion cluster/examples/kubernetes/ceph/operator-openshift.yaml
Expand Up @@ -403,7 +403,9 @@ data:
# Whether to start the discovery daemon to watch for raw storage devices on nodes in the cluster.
# This daemon does not need to run if you are only going to create your OSDs based on StorageClassDeviceSets with PVCs.
ROOK_ENABLE_DISCOVERY_DAEMON: "false"
# Enable volume replication controller
# Enable the volume replication controller
# Before enabling, ensure the Volume Replication CRDs are created.
# See https://rook.io/docs/rook/latest/ceph-csi-drivers.html#rbd-mirroring
CSI_ENABLE_VOLUME_REPLICATION: "false"
# The timeout value (in seconds) of Ceph commands. It should be >= 1. If this variable is not set or is an invalid value, it's default to 15.
ROOK_CEPH_COMMANDS_TIMEOUT_SECONDS: "15"
Expand Down
4 changes: 3 additions & 1 deletion cluster/examples/kubernetes/ceph/operator.yaml
Expand Up @@ -329,7 +329,9 @@ data:
ROOK_ENABLE_DISCOVERY_DAEMON: "false"
# The timeout value (in seconds) of Ceph commands. It should be >= 1. If this variable is not set or is an invalid value, it's default to 15.
ROOK_CEPH_COMMANDS_TIMEOUT_SECONDS: "15"
# Enable volume replication controller
# Enable the volume replication controller.
# Before enabling, ensure the Volume Replication CRDs are created.
# See https://rook.io/docs/rook/latest/ceph-csi-drivers.html#rbd-mirroring
CSI_ENABLE_VOLUME_REPLICATION: "false"
# CSI_VOLUME_REPLICATION_IMAGE: "quay.io/csiaddons/volumereplication-operator:v0.1.0"

Expand Down
14 changes: 7 additions & 7 deletions go.mod
Expand Up @@ -7,7 +7,7 @@ require (
github.com/banzaicloud/k8s-objectmatcher v1.1.0
github.com/ceph/go-ceph v0.11.0
github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f
github.com/csi-addons/volume-replication-operator v0.1.1-0.20210525040814-ab575a2879fb
github.com/csi-addons/volume-replication-operator v0.2.0
github.com/ghodss/yaml v1.0.1-0.20190212211648-25d852aebe32
github.com/go-ini/ini v1.51.1
github.com/google/go-cmp v0.5.5
Expand All @@ -31,14 +31,14 @@ require (
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c
gopkg.in/ini.v1 v1.57.0
gopkg.in/yaml.v2 v2.4.0
k8s.io/api v0.21.2
k8s.io/apiextensions-apiserver v0.21.1
k8s.io/apimachinery v0.21.2
k8s.io/client-go v0.21.2
k8s.io/api v0.22.1
k8s.io/apiextensions-apiserver v0.21.3
k8s.io/apimachinery v0.22.1
k8s.io/client-go v0.22.1
k8s.io/cloud-provider v0.21.1
k8s.io/kube-controller-manager v0.21.1
k8s.io/utils v0.0.0-20210527160623-6fdb442a123b
sigs.k8s.io/controller-runtime v0.9.0
k8s.io/utils v0.0.0-20210722164352-7f3ee0f31471
sigs.k8s.io/controller-runtime v0.9.6
sigs.k8s.io/sig-storage-lib-external-provisioner/v6 v6.1.0
)

Expand Down

0 comments on commit 0bd34eb

Please sign in to comment.