Skip to content

Commit

Permalink
fence: add RPC to get the client address
Browse files Browse the repository at this point in the history
Adding a RPC to get the local client details
which includes the id and the local ip addresses
for fencing. The ID can be anything that can be
used as an identifier about the client address.
For example the ID can be the cephcluster UUID
and the ip addressed/cidr is the local client
addresses used to connect to the ceph cluster,
The ceph is an example/representation here.

Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
  • Loading branch information
Madhu-1 committed Oct 29, 2024
1 parent fed99fb commit 66639b5
Show file tree
Hide file tree
Showing 4 changed files with 406 additions and 48 deletions.
39 changes: 39 additions & 0 deletions fence/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,11 @@ service FenceController {
// ListClusterFence RPC call to provide a list of blocklisted/fenced clients.
rpc ListClusterFence(ListClusterFenceRequest)
returns (ListClusterFenceResponse){}
// GetFenceClients RPC calls to get the clients information that needs
// to be fenced.
rpc GetFenceClients(GetFenceClientsRequest)
returns (GetFenceClientsResponse){}
}
```

Expand Down Expand Up @@ -145,6 +150,40 @@ message CIDR {
}
```

### GetFenceClients

```protobuf
// GetFenceClientsRequest contains the necessary information to identify
// the clients that need fencing.
message GetFenceClientsRequest {
// Plugin-specific parameters passed in as opaque key-value pairs.
map<string, string> parameters = 1;
// Secrets required by the plugin to complete the request.
map<string, string> secrets = 2 [(csi.v1.csi_secret) = true];
}
// GetFenceClientsResponse holds the information about clients that require
// fencing.
message GetFenceClientsResponse {
// List of clients that need to be fenced.
repeated ClientDetails clients = 1;
}
```

### ClientDetails

```protobuf
// ClientDetails holds the information about the client that requires fencing.
message ClientDetails {
// id represents the unique identifier of the client.
// Required field.
string id = 1;
// list of IP addresses that represent the client's local addresses.
// Required field.
repeated CIDR addresses = 2;
}
```

#### Error Scheme

| Condition | gRPC Code | Description | Recovery Behavior |
Expand Down
29 changes: 29 additions & 0 deletions fence/fence.proto
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@ service FenceController {
// ListClusterFence RPC call to provide a list of blocklisted/fenced clients.
rpc ListClusterFence(ListClusterFenceRequest)
returns (ListClusterFenceResponse){}

// GetFenceClients RPC calls to get the clients information that needs
// to be fenced.
rpc GetFenceClients(GetFenceClientsRequest)
returns (GetFenceClientsResponse){}
}
// FenceClusterNetworkRequest contains the information needed to identify
// the storage cluster so that the appropriate fencing operation can be
Expand Down Expand Up @@ -78,3 +83,27 @@ message CIDR {
// CIDR block
string cidr = 1;
}
// GetFenceClientsRequest contains the necessary information to identify
// the clients that need fencing.
message GetFenceClientsRequest {
// Plugin-specific parameters passed in as opaque key-value pairs.
map<string, string> parameters = 1;
// Secrets required by the plugin to complete the request.
map<string, string> secrets = 2 [(csi.v1.csi_secret) = true];
}

// GetFenceClientsResponse holds the information about clients that require
// fencing.
message GetFenceClientsResponse {
// List of clients that need to be fenced.
repeated ClientDetails clients = 1;
}
// ClientDetails holds the information about the client that requires fencing.
message ClientDetails {
// id represents the unique identifier of the client.
// Required field.
string id = 1;
// list of IP addresses that represent the client's local addresses.
// Required field.
repeated CIDR addresses = 2;
}
Loading

0 comments on commit 66639b5

Please sign in to comment.