Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions PendingReleaseNotes.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,16 @@

## Features

1. Added `GetReplicationDestinationInfo` RPC to map source volume/volume
group IDs to destination IDs across mirrored clusters. This enables DR
orchestrators to discover the correct destination volume IDs when pools
have different IDs across clusters. The RPC supports:
- Volume replication: Maps source volume ID to destination volume ID
- Volume group replication: Maps source group ID and all member volume
IDs to their destination IDs
- Pool name-based mapping via `replicationDestination` ConfigMap
configuration
- Backward compatibility with existing cluster-mapping.json via
ClientProfileMapping integration

## NOTE
30 changes: 30 additions & 0 deletions api/deploy/kubernetes/csi-config-map.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ type ClusterInfo struct {
NFS NFS `json:"nfs"`
// Read affinity map options
ReadAffinity ReadAffinity `json:"readAffinity"`
// ReplicationDestination defines the destination cluster for replication.
// Populated by ceph-csi-operator from ReplicationDestinationConfig CR.
// +optional
ReplicationDestination *ReplicationDestinationInfo `json:"replicationDestination,omitempty"`
}

type CephFS struct {
Expand Down Expand Up @@ -74,3 +78,29 @@ type ReadAffinity struct {
Enabled bool `json:"enabled"`
CrushLocationLabels []string `json:"crushLocationLabels"`
}

// ReplicationDestinationInfo contains destination cluster information for
// replication. It enables the CSI driver to map source volume/group IDs
// to destination volume/group IDs when pool IDs differ across clusters.
type ReplicationDestinationInfo struct {
// RemoteClusterID is the clusterID of the destination cluster
RemoteClusterID string `json:"remoteClusterID"`
// RBD contains RBD-specific replication destination configuration
// +optional
RBD *RemoteRBDDetails `json:"rbd,omitempty"`
}

// RemoteRBDDetails contains RBD-specific remote cluster details for replication.
type RemoteRBDDetails struct {
// RemotePoolMapping maps pool names to remote pool details.
// Key: pool name (e.g., "rbd", "replicapool")
// If empty, pool IDs are assumed identical on both clusters.
// +optional
RemotePoolMapping map[string]RemotePoolDetails `json:"remotePoolMapping,omitempty"`
}

// RemotePoolDetails contains details of a pool on the remote cluster.
type RemotePoolDetails struct {
// PoolID is the remote pool ID as a decimal string (e.g., "5")
PoolID string `json:"poolID"`
}
10 changes: 10 additions & 0 deletions docs/design/proposals/replication-destination-info.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,16 @@ indefinitely).

## Proposal

### Capability Advertisement

The CSI driver **must** advertise the `GET_REPLICATION_DESTINATION_INFO`
capability via the `GetCapabilities` RPC. This allows DR orchestrators to
discover whether the driver supports this feature.

```go
identity.Capability_VolumeReplication_GET_REPLICATION_DESTINATION_INFO
```

### Architecture

```
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ require (
github.com/ceph/go-ceph v0.40.0
github.com/container-storage-interface/spec v1.12.0
github.com/csi-addons/kubernetes-csi-addons v0.14.0
github.com/csi-addons/spec v0.2.1-0.20250610152019-b5a7205f6a79
github.com/csi-addons/spec v0.2.1-0.20260515055340-d4a373713b9a
github.com/gemalto/kmip-go v0.1.0
github.com/ghodss/yaml v1.0.1-0.20190212211648-25d852aebe32
github.com/golang/protobuf v1.5.4
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -513,8 +513,8 @@ github.com/container-storage-interface/spec v1.12.0/go.mod h1:txsm+MA2B2WDa5kW69
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
github.com/csi-addons/kubernetes-csi-addons v0.14.0 h1:aH4w1X9z6eOqbKvh9Q4M0YzksaUgQDU3aTU/fblG4yI=
github.com/csi-addons/kubernetes-csi-addons v0.14.0/go.mod h1:jG5S4Txts6WHt8QmyfpIXB00HYPpawWPcyViW+Xppgc=
github.com/csi-addons/spec v0.2.1-0.20250610152019-b5a7205f6a79 h1:ditFTa+wl7DLanGQHSS/AwuITGuWeBXyl7syPO4n+4s=
github.com/csi-addons/spec v0.2.1-0.20250610152019-b5a7205f6a79/go.mod h1:Mwq4iLiUV4s+K1bszcWU6aMsR5KPsbIYzzszJ6+56vI=
github.com/csi-addons/spec v0.2.1-0.20260515055340-d4a373713b9a h1:AxvSsTN8TxwpeP6X/ScNK5i+6eXu3APRfuIXSEMENVQ=
github.com/csi-addons/spec v0.2.1-0.20260515055340-d4a373713b9a/go.mod h1:Mwq4iLiUV4s+K1bszcWU6aMsR5KPsbIYzzszJ6+56vI=
github.com/cyphar/filepath-securejoin v0.6.1 h1:5CeZ1jPXEiYt3+Z6zqprSAgSWiggmpVyciv8syjIpVE=
github.com/cyphar/filepath-securejoin v0.6.1/go.mod h1:A8hd4EnAeyujCJRrICiOWqjS1AX0a9kM5XL+NwKoYSc=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
Expand Down
6 changes: 6 additions & 0 deletions internal/csi-addons/rbd/identity.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,12 @@ func (is *IdentityServer) GetCapabilities(
Type: identity.Capability_VolumeReplication_VOLUME_REPLICATION,
},
},
}, &identity.Capability{
Type: &identity.Capability_VolumeReplication_{
VolumeReplication: &identity.Capability_VolumeReplication{
Type: identity.Capability_VolumeReplication_GET_REPLICATION_DESTINATION_INFO,
},
},
}, &identity.Capability{
Type: &identity.Capability_VolumeGroup_{
VolumeGroup: &identity.Capability_VolumeGroup{
Expand Down
Loading
Loading